Salz0 / telegram_flea

A open-source flea market bot, to be used in any Community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run project // KeyError: 'TELEGRAM_BOT_TOKEN'

profoundboy opened this issue · comments

Okay so prior to my earlier issue raised i have all my modules installed via poetry & my environment set up however i still come across a KeyError of a missing env variable.

Steps to reproduce
Run project from scratch with python main.py

Expected result:
Bot started (success message)

Actual result:

Traceback (most recent call last):
  File "/Users/macbookpro/telegram_flea/main.py", line 18, in <module>
    bot = aiogram.Bot(os.environ["TELEGRAM_BOT_TOKEN"])
                      ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 679, in __getitem__
KeyError: 'TELEGRAM_BOT_TOKEN'

Screenshots
dummy

Based on .env.example, you should create a .env file and fill out the variables

If you have any further questions, don't hesitate to reopen this issue

@profoundboy please use this to get your token: https://t.me/BotFather

https://t.me/BotFather

Oh great! thank you!