Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularize handlers #3

Open
zeroone2numeral2 opened this issue Nov 21, 2021 · 0 comments
Open

Modularize handlers #3

zeroone2numeral2 opened this issue Nov 21, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@zeroone2numeral2
Copy link
Owner

All handlers should be in a dedicated handlers/ directory where we initialize all handlers and then we import it in the main file

import handlers.santa_buttons
import handlers.private
...

dispatcher.add_handler(handlers.private.start)
dispatcher.add_handler(handlers.private.help)
dispatcher.add_handler(handlers.santa_buttons.start_match)
...

eg. handlers/private.py

def on_start_command(update, context):
  pass

start = CommandHandler("start", on_start_command)
@zeroone2numeral2 zeroone2numeral2 added the enhancement New feature or request label Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant