From f5cb1d85cda0d70f7bad5b94ab2e17795e45b1f5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 15 Nov 2015 16:03:20 +0100 Subject: [PATCH] Revert "Revert "Ho cambiato qualcosa. Cosa? Boh."" This reverts commit 0ac1abc63479f174301c2fcfe02c0a4ac4b65203. --- telegram.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/telegram.py b/telegram.py index 460bedf7..6705cb49 100644 --- a/telegram.py +++ b/telegram.py @@ -43,7 +43,6 @@ def sendMessage(content, to): def forwardMessage(msg, sentby, to): """Inoltra un messaggio mandato in un'altra chat.""" - #Parametri del messaggio parametri = { 'chat_id': to, 'from_chat_id': sentby, @@ -52,6 +51,16 @@ def forwardMessage(msg, sentby, to): #Manda la richiesta ai server di Telegram. requests.get("https://api.telegram.org/bot" + telegramtoken + "/forwardMessage", params=parametri) +def sendPhoto(pic, text, to): + """Manda una foto compressa a una chat.""" + parametri = { + 'chat_id': to, + 'photo': pic, + 'caption': text, + } + #Manda la richiesta ai server di Telegram. + requests.get("https://api.telegram.org/bot" + telegramtoken + "/sendPhoto", params=parametri) + def sendAudio(aud, to): """Manda un file audio .mp3 a una chat.""" parametri = { @@ -117,4 +126,4 @@ def sendChatAction(to, type='typing'): 'action': type, } #Manda la richiesta ai server di Telegram. - requests.get("https://api.telegram.org/bot" + telegramtoken + "/sendChatAction", params=parametri) + requests.get("https://api.telegram.org/bot" + telegramtoken + "/sendChatAction", params=parametri) \ No newline at end of file