Problems with a twitch bot

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

its alerdy on it through updating and anything

1 Like

Do you get the error after you installed it?

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.

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

ik that that i maded that and imported it

1 Like

and i replace “Bot_token” with the name of the secret on it?

  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