Skip to content

Commit

Permalink
Updated the handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Jkarage committed Oct 17, 2023
1 parent 592adb7 commit 93b20c0
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ async def help(update: Update, context: CallbackContext)->None:

async def main() -> None:
"""Set up the application and a custom webserver."""


# Run application and webserver together
async with application:
await application.start()
await webserver.serve()
await application.stop()

if __name__ == "__main__":
context_types = ContextTypes(context=CustomContext)
application = (
Application.builder().token(os.getenv("TELEGRAM_BOT_TOKEN")).updater(None).context_types(context_types).build()
Expand Down Expand Up @@ -168,13 +173,4 @@ async def telegram(request: Request) -> Response:
)
)



# Run application and webserver together
async with application:
await application.start()
await webserver.serve()
await application.stop()

if __name__ == "__main__":
asyncio.run(main())
main()

0 comments on commit 93b20c0

Please sign in to comment.