R
R
Radiss2020-09-27 21:59:30
Fonts
Radiss, 2020-09-27 21:59:30

How to solve token error with aiogram library?

With a token from the git repository, the bot started normally. But after creating a new project, another bot in telegrams, changing the token and config and environment with pyenv and direnv, an error appears in the console:

python3.8 app.py
Traceback (most recent call last):
  File "app.py", line 17, in <module>
    from handlers import dp
  File "/home/user/Home/ASITES/python/botch1bot/handlers/__init__.py", line 1, in <module>
    from .errors import dp
  File "/home/user/Home/ASITES/python/botch1bot/handlers/errors/__init__.py", line 1, in <module>
    from .error_handler import dp
  File "/home/user/Home/ASITES/python/botch1bot/handlers/errors/error_handler.py", line 3, in <module>
    from loader import dp
  File "/home/user/Home/ASITES/python/botch1bot/loader.py", line 6, in <module>
    bot = Bot(token=config.BOT_TOKEN, parse_mode=types.ParseMode.HTML)
  File "/home/user/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiogram/bot/base.py", line 61, in __init__
    api.check_token(token)
  File "/home/user/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiogram/bot/api.py", line 38, in check_token
    raise exceptions.ValidationError('Token is invalid!')
aiogram.utils.exceptions.ValidationError: Token is invalid!


project on github: Marlin005/botch

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Neron, 2015-12-06
Lordov @Nekto_Habr

I bet 50 kopecks that the font is custom-drawn, most likely someone else's, but modified. It is quite possible to rivet this on your knee from black helvetica, a chandelier and a little zeal.

S
soremix, 2020-09-27
@SoreMix

No matter how incredible it is, you have an invalid token. Print the token, have a look

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question