mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update echo_bot.py
Error TOKEN
File "D:\HlamProjects\Python\TelegramBot\main.py", line 57, in <module>
asyncio.run(main())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\HlamProjects\Python\TelegramBot\main.py", line 50, in main
bot = Bot(TOKEN, parse_mode=ParseMode.HTML)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\aiogram\client\bot.py", line 258, in __init__
validate_token(token)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\aiogram\utils\token.py", line 17, in validate_token
raise TokenValidationError(
aiogram.utils.token.TokenValidationError: Token is invalid! It must be 'str' type instead of <class 'NoneType'> type.
Need TOKEN = "BOT_TOKEN"
This commit is contained in:
parent
cf3044687a
commit
298cb4b49a
1 changed files with 2 additions and 1 deletions
|
|
@ -10,7 +10,8 @@ from aiogram.types import Message
|
|||
from aiogram.utils.markdown import hbold
|
||||
|
||||
# Bot token can be obtained via https://t.me/BotFather
|
||||
TOKEN = getenv("BOT_TOKEN")
|
||||
#TOKEN = getenv("BOT_TOKEN") # ERROR geteven
|
||||
TOKEN = "BOT_TOKEN"
|
||||
|
||||
# All handlers should be attached to the Router (or Dispatcher)
|
||||
dp = Dispatcher()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue