i have a problem with dynaconf .secrets
kahcepba
TRIALOP

2 years ago

when i ru me telegram botlocally - it works fine.

But when i deploy it to railway, i receive this error. Help

I use Dynaconf settings.toml and .secrets.toml

Traceback (most recent call last):

File "/app/bot.py", line 27, in

bot = Bot(settings.BOT_TOKEN)

File "/opt/venv/lib/python3.9/site-packages/aiogram/bot/base.py", line 77, in init

api.check_token(token)

File "/opt/venv/lib/python3.9/site-packages/aiogram/bot/api.py", line 75, in check_token

raise exceptions.ValidationError('Token is invalid!')

View Deploy details

> ⓘ Deployment information is only viewable by Project members and Railway admins.

Archived

2 Replies

2 years ago

Please use environment variables for sensitive information such as a bot token.


kahcepba
TRIALOP

2 years ago

Please use environment variables for sensitive information such as a bot token.

Thanks. And what should I write in the bot code?

Could you describe it in more detail?


2 years ago

I'm sorry but we wouldn't be able to offer coding help here, these forums are designed for platform help.

I would recommend reading up on how to use environment variables with your language, here are the docs on how you add environment variables to your Railway service - https://docs.railway.app/guides/variables#service-variables

Status changed to Archived brody about 2 years ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...