Salz0 / telegram_flea

A open-source flea market bot, to be used in any Community
MIT License
9 stars 21 forks source link

Unable to run project // KeyError: 'TELEGRAM_BOT_TOKEN' #62

Closed profoundboy closed 9 months ago

profoundboy commented 9 months ago

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

Salz0 commented 9 months ago

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

Salz0 commented 9 months ago

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

mykolasolodukha commented 9 months ago

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

profoundboy commented 9 months ago

https://t.me/BotFather

Oh great! thank you!