-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
29 lines (23 loc) · 943 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from auth import TOKEN
import bot
from telegram.ext import Updater, CommandHandler, InlineQueryHandler, CallbackQueryHandler
def main():
updater = Updater(TOKEN, use_context=True)
dispatcher = updater.dispatcher
# se añaden los métodos que controlan cada comando
# TODO add active cases maps
dispatcher.add_handler(CommandHandler('start', bot.start))
dispatcher.add_handler(CommandHandler('total', bot.total))
dispatcher.add_handler(CommandHandler('mapa', bot.mapa))
dispatcher.add_handler(CommandHandler('muertes', bot.muertes))
# for inline queries
dispatcher.add_handler(InlineQueryHandler(bot.inline_query))
dispatcher.add_error_handler(bot.error)
# keyboard
dispatcher.add_handler(CommandHandler('test', bot.test))
dispatcher.add_handler(CallbackQueryHandler(bot.button))
# iniciar bot
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()