DEV Community

Discussion on: Let's make a Twitch bot with Python!

Collapse
 
spiringosu profile image
Spiring

I figured this out. What you want to do is put in what is in these quotations for each of the environments into bot.py instead of .env.
"os.environ['TMI_TOKEN']=
os.environ['CLIENT_ID']=
os.environ['BOT_NICK']=
os.environ['BOT_PREFIX']=
os.environ['CHANNEL']=
"
For some reason, the OP didn't specify how to call the .env file before it tries to run the rest of bot.py, but doing that eliminates the need for .env

Collapse
 
sunnybirdboi profile image
sunnybirdboi

I'm getting the same issue and cannot figure out where to put your solution. I've tried putting the .env info directly into bot.py as variables to eliminate the need for the .env, and I still get the KeyError despite any changes I make. Where am I putting this info to fix this problem? Thank you!