Added __name__=__main__ for easier startup

Also made replies silent
This commit is contained in:
JuliusFreudenberger 2020-05-12 22:27:47 +02:00
parent 3510c87e4d
commit bb1a7ce99a

13
bot.py
View file

@ -96,7 +96,7 @@ def handle_vvs(update, context):
departures = get_vvs_departures(query) departures = get_vvs_departures(query)
for reply in departures: for reply in departures:
update.message.reply_text(reply) update.message.reply_text(reply, disable_notification=True)
def parse_station(args): def parse_station(args):
@ -168,12 +168,17 @@ def error_callback(update, context):
return return
def __main__():
inline_station_search_handler = InlineQueryHandler(inline_station_search) inline_station_search_handler = InlineQueryHandler(inline_station_search)
dispatcher.add_handler(inline_station_search_handler) dispatcher.add_handler(inline_station_search_handler)
dispatcher.add_handler(CommandHandler('vvs', handle_vvs)) dispatcher.add_handler(CommandHandler('vvs', handle_vvs))
dispatcher.add_error_handler(error_callback)
dispatcher.add_handler(CallbackQueryHandler(handle_multiple_stations_reply))
dispatcher.add_error_handler(error_callback)
dispatcher.add_handler(CallbackQueryHandler(handle_multiple_stations_reply))
updater.start_polling() updater.start_polling()
updater.idle() updater.idle()
if __name__ == "__main__":
__main__()