Beispiel #1
0
def main():
    updater = Updater("634780311:AAHPQxaVkPv522pKwiMKxu5NrIzz1NVKXtY")
    dp = updater.dispatcher
    dp = tbot.DialogDispatcher(dp.bot, dp.update_queue)
    updater.dispatcher = dp

    dp.add_handler(CommandHandler("start", actions.start))
    dp.add_handler(CommandHandler("new", actions.new))
    dp.add_handler(CommandHandler("addAlts", actions.addAlts))
    dp.add_handler(CommandHandler("addFactors", actions.addFactors))
    dp.add_handler(CommandHandler("showAlts", actions.showAlts))
    dp.add_handler(CommandHandler("showFactors", actions.showFactors))
    dp.add_handler(CommandHandler("setupAlts", actions.askingAltSetup))
    dp.add_handler(CommandHandler("setupFactors", actions.askingFactorSetup))
    dp.add_handler(CommandHandler("decide", actions.decide))
    dp.add_handler(CommandHandler("stop", actions.stop))

    dp.add_error_handler(errorHandler)

    # Start the Bot
    updater.start_polling()

    # Run the bot until you press Ctrl-C or the process receives SIGINT,
    # SIGTERM or SIGABRT. This should be used most of the time, since
    # start_polling() is non-blocking and will stop the bot gracefully.
    updater.idle()