Skip to content Skip to sidebar Skip to footer

Twitchio: How To Send A Chat Message?

Is there a way to send a message via the TwitchIO library? for example, send a message if the time is 10:43 PM? This is not an event nor a message from twitch chat, that's an if/el

Solution 1:

Got some pointers from the TwitchIO discord chat logs where this has been asked few times.

Due to async nature you have to add a task to the running event loop from external code having reference to the bot like this:

chan = bot.get_channel("channelname")
loop = asyncio.get_event_loop()
loop.create_task(chan.send("Send this message"))

Post a Comment for "Twitchio: How To Send A Chat Message?"