I wanted to create my own twitch chat bot, but something went wrong. My account’s channel on twitch is qowevisa. And so I wrote in .env file “CHANNEL=qowevisa”.
In my bot.py file I wrote these lines:
bot = commands.Bot(
BUT. When I’m writing “pipenv run python bot.py” in my window’s shell, it returns me that kind of error
I’d like to know that’s a typical error, but eighter I’m not so smart, or it is something strange.
At a guess you need
But depends on the program. Channels are preceeded with a
# for joining purposes. Like IRC
Thanks for very fast replying, but it didn’t fix the problem.
I tried to rename “the owner” in twitch developers tab, but only when I set every name to my own name it stopped sending me errors. It just was trying to load variables. I think it stopped working because in the channel was a viewer with the name “qowevisa”.
Then the issue is somewhere else in the program you have written. Which we can’t really debug because it’s your program.
We’d need to see the source.
The name in the Twitch Developers tab/console. Assuming you mean https://dev.twitch.tv/console/ the “name” has no bearing on your programs operation.
I was copying the code and everything from
But they said nothing about how shall I fill the .env file.
Just to clear everything.
In my .env file TMI_TOKEN is oauth from Twitch Chat Password Generator
CLIENT_ID is Client_id in my app in twitch dev
BOT_NICK is just a name and I can set it to whatever I want
CHANNEL is my twitch account
Is it like that? If it is, okay, I’ll close this topic if I can and just go try it one more time and go trying to solve the problem by my own.
in your .env the code seems to drop the ‘#’ so it’s not joining the channel. I’m not 100% familiar with python env file usage.
Could just skip using env for now and hardcode it to get your bot going.
There is also someone in the comments on the devto post with the same issue with no resolution…
Okay. So. I’m really dumb. I was trying to create a bot from my own acc. So I created another acc and everything is fine.
So, I think if .env and code are fine, your problem is that you’re trying to create yourself into a bot…
But the code should of worked fine using your account, as it authenticates using username + oAuth. shrug
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.