NUNSur
March 22, 2023, 7:32pm
1
Question:
I am creating a twitch bot with Python with its all ready and set but no reason THEY Not work even its updated and everthing
how?
Repl link:
Repl
code snippet
`Traceback (most recent call last):
File “main.py”, line 1, in
from twitchio.oauth import OAuth
ModuleNotFoundError: No module named ‘twitchio.oauth’
Did you install twitchio with no errors? You usually need to install the package.
1 Like
NUNSur
March 22, 2023, 7:38pm
3
its alerdy on it through updating and anything
1 Like
Do you get the error after you installed it?
NUNSur
March 22, 2023, 7:41pm
5
like when u run it?
File "main.py", line 1, in <module>
from twitchio.oauth import OAuth
ModuleNotFoundError: No module named 'twitchio.oauth'
I don’t think twitchio comes with oauth. I checked the docs and nothing came up.
NUNSur
March 22, 2023, 7:42pm
7
so whats the thing to make the twitch bot working?
from twitchio.ext import commands
bot = commands.bot(bot_token)
Also, please use secrets to store your token, or else someone could probably hack your bot easily.
1 Like
NUNSur
March 22, 2023, 7:46pm
9
ik that that i maded that and imported it
1 Like
NUNSur
March 22, 2023, 7:47pm
10
and i replace “Bot_token” with the name of the secret on it?
NUNSur
March 22, 2023, 7:50pm
11
File "main.py", line 5, in <module>
bot = commands.bot(bot_token)
NameError: name 'bot_token' is not defined
im still stupid in it
bot_token should be the token. So:
from os import getenv
bot_token = getenv("Your Secret Name")
1 Like