donBarbos / telegram-bot-template

🤖 Template for telegram bot using postgres, pgbouncer, redis, docker, amplitude, prometheus, grafana, CI with admin panel
GNU Lesser General Public License v3.0
274 stars 50 forks source link

Fix first query response localization #282

Closed zytfo closed 3 months ago

zytfo commented 3 months ago

When the bot starts, the response of the first request should be according to the user's localization, not default

donBarbos commented 3 months ago

Hello and thanks for your PR, but I18nMiddleware is performed after AuthMiddleware, which saves language_code in db so this check may be unnecessary. If I am missing something - tell me about it

zytfo commented 3 months ago

Hello and thanks for your PR, but I18nMiddleware is performed after AuthMiddleware, which saves language_code in db so this check may be unnecessary. If I am missing something - tell me about it

Hi. Thanks for your reply. Indeed, I18nMiddleware performs before AuthMiddleware causing not having user while getting localization.