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'
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
Oh great! thank you!