Chat bot seems to hang


I’m making a simple chat bot to explore the Twitch API with Python and the TwitchIO library, but I’m running into some issue executing my bot. I setup the application through the developer portal, followed the Authorization code grant flow guide to get my code and access token, and validated that access token using the curl command.

All of that seems to be working well, but when I invoke the, I don’t get a print out confirming my login and the program just seems to sit idle. I stepped through the code in the debugger and it never seems to schedule my bot events. Currently, the code is very simple:

bot = commands.Bot(

async def event_ready():
    print(f'Logged in as | {bot.nick}')

if __name__ == '__main__':

I do see after the initial scheduling that my bot appears to login as the nick and user ID do populate, but it doesn’t ever seem to reach my login message event. I initially provided the scope as: chat:read+chat:edit+channel:moderate, could this be an issue related to scoping? Any help would be greatly appreciated!


The issue here is that you have missed the parenthesis on the event decorator

async def event_ready():
    print(f'Logged in as | {bot.nick}')

In future, you would be better off posting this question on the Discord server, that is linked in the docs and github, of TwitchIO.
We will be able to be provide more extensive help there and in a more timely fashion.