Request to join the "srizbi" channel has timed out. Make sure the channel exists

OS: Windows 10
Python: Python 3.7.7

I am encountering an error whilst running SriZbot to connect to my channel:

Request to join the "srizbi" channel has timed out. Make sure the channel exists.

I installed pipenv: pip install pipenv, created a virtual environment for Python 3.7: pipenv --python 3.7 and then installed twitchio: pipenv install twitchio, and run my code using: pipenv run python SriZbot.py.

I obtained my OAUTH key: https://twitchapps.com/tmi/

I created an Application: https://dev.twitch.tv/console/apps

Name: SriZbot
OAuth Redirect URLs: http://localhost/
Category: Chat Bot

I setup .env configuration:

# SriZbot.env
TMI_TOKEN="oauth:removed"
CLIENT_ID="removed"
BOT_NICK="SriZbot"
BOT_PREFIX="!"
CHANNEL="SriZbi"

I created SriZbot.py script:

# SriZbot.py
import os # for importing env vars for the bot to use
from twitchio.ext import commands

bot = commands.Bot(
    # set up the bot
    irc_token=os.environ['TMI_TOKEN'],
    client_id=os.environ['CLIENT_ID'],
    nick=os.environ['BOT_NICK'],
    prefix=os.environ['BOT_PREFIX'],
    initial_channels=[os.environ['CHANNEL']]
)

if __name__ == "__main__":
    bot.run()

CHANNEL=“SriZbi”

Should be

CHANNEL="#srizbi"

usually

@BarryCarlyon Thanks for your reply - I tried that, but unfortunately, I get the same error .

Turn on raw debugging and confirm you are actually connecting to Twitch.

Aside from that I don’t see anything else obvious as to the issue.

Your provider could be blocking IRC/Chat traffic

Unless your bot is banned from your channel.

@BarryCarlyon I turned on the debug and the exception is occurring at the ‘TMI_TOKEN’.

I requested a new token: https://twitchapps.com/tmi/

Entered it in the .env configuration, but I still get the same error.

srizbot doesn’t appear to be an actual user, which would be why you’re getting an error. You can’t log in to Chat with accounts aren’t aren’t the one going through the OAuth flow to grant the token.

1 Like

is the TMI token for the user srizbot?

My mistake, I understood that to be a nickname, but I was mistaken.

I changed BOT_NICK=“srizbi” and I am attempting to run the script again now, but it appears to be stuck:

Loading .env environment variables…

Can I connect to my own channel (SriZbi) using a bot of the same name (srizbi)? Or do I need to create a new Twitch account for the bot?

yes

as long as the token is for that user.

usernames should be specified in lower case like channel names

@BarryCarlyon Thanks for the confirmation. It appears that something is still wrong because the script will not proceed beyond:

Loading .env environment variables…

Can’t really help with that one!

Typo or syntax error in your code. Or it did connect and it has nothing else to do

@BarryCarlyon @Dist Appreciate your help, we’re up and running!! :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.