From 1eafab1b40afe55c026cf0f0ba7a7154109b995c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 21 Apr 2016 18:57:23 +0200 Subject: [PATCH] Aggiunto comando ping al bot per testare il funzionamento --- main.py | 12 ++++++++++++ mifia.py | 5 ----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 main.py delete mode 100644 mifia.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..e71641c --- /dev/null +++ b/main.py @@ -0,0 +1,12 @@ +from telegram.ext import Updater +import filemanager + +token = filemanager.readfile('telegramapi.txt') +updater = Updater(token) + + +def ping(bot, update): + bot.sendMessage(update.message.chat.id, "Pong!") + +updater.dispatcher.addTelegramCommandHandler('ping', ping) +updater.start_polling() \ No newline at end of file diff --git a/mifia.py b/mifia.py deleted file mode 100644 index ee3cb21..0000000 --- a/mifia.py +++ /dev/null @@ -1,5 +0,0 @@ -import telegram -import filemanager - -token = filemanager.readfile('telegramapi.txt') -bot = telegram.Bot(token)