Skip to content

Instantly share code, notes, and snippets.

@daviddanielng
Created February 12, 2024 19:20
Show Gist options
  • Save daviddanielng/1c9198e61a45a08a916856c354a524b8 to your computer and use it in GitHub Desktop.
Save daviddanielng/1c9198e61a45a08a916856c354a524b8 to your computer and use it in GitHub Desktop.
def start():
# application = ApplicationBuilder().token()
conf = Conf("/workspaces/MAS-Oasis/bot/confg.json")
application = ApplicationBuilder().token(conf.get_settings("token")).build()
application.add_handler(CommandHandler(
"support", how_to_support))
application.add_handler(CommandHandler(
"start", listen_for_start, filters=filters.ChatType.SUPERGROUP))
application.add_handler(CommandHandler(
"help", listen_for_help, filters=filters.ChatType.SUPERGROUP))
application.add_handler(CommandHandler(
"help", listen_for_help, filters=filters.ChatType.GROUP))
application.add_handler(CommandHandler(
"start", listen_for_start, filters=filters.ChatType.GROUP))
application.add_handler(CommandHandler(
"help", listen_for_help_private, filters=filters.ChatType.PRIVATE))
application.add_handler(CommandHandler(
"start", listen_for_start, filters=filters.ChatType.PRIVATE))
application.add_handler(CommandHandler(
"tutorial", tutorial, filters=filters.ChatType.PRIVATE))
application.add_handler(search.start_search())
application.add_handler(search.start_search())
application.add_handler(suggestion.start_suggest())
application.add_handler(recommend.start_recommend())
application.add_handler(MessageHandler(
filters.COMMAND & filters.ChatType.SUPERGROUP, wrong_command))
application.add_handler(MessageHandler(
filters.COMMAND & filters.ChatType.GROUP, wrong_command))
application.add_handler(MessageHandler(
filters.COMMAND & filters.ChatType.PRIVATE, wrong_command_private))
test(application, conf)
application.run_polling()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment