Setup sqlite for storing auth data.
Setup a bot with BotFather on Telegram. Make the app read that token from an environment variable.
Read Discourse API token from Env variable.
Create an endpoint for setting up Discourse authorization. Visiting that endpoint should present a form that asks you for your username and telegram chat ID. Then the bot sends a discourse message to that username with a unique link. Clicking it will save the user id and telegram chat id in sqlite for later use.