I’m building a chatbot for Twitch and I’ve got some basic functionality working. The bot can respond to commands and display text messages in chat.
My issue is that I want to use Twitch’s /announce moderator feature to make my bot’s responses appear as highlighted announcements instead of regular chat messages. However, whenever I try to send the /announce command through my bot, I keep getting Unrecognized command: /announce error.
The bot account has moderator permissions in the channel. Here’s my current implementation:
The /announce command doesn’t work through IRC that most Twitch bots use. Even with mod permissions, IRC bots can’t run slash commands like /announce, /timeout, or /ban - they only send regular chat messages. You’ll need Twitch’s EventSub API or their newer chat API endpoints for announcement features. Some devs work around this by having the bot send normal messages, then use channel point rewards or other triggers to manually announce stuff. You could also use Twitch’s Helix API with the right OAuth scopes for mod actions, but that’s way more complex than basic IRC chat.
Your bot’s trying to use /announce through IRC, but that command isn’t supported there. I ran into the same thing building my own Twitch bot. You need to switch from IRC to Twitch’s Chat API instead. Get proper OAuth tokens with moderator scope, then POST to https://api.twitch.tv/helix/chat/announcements with your message in the body. It’s more setup than IRC, but you’ll get all the moderator features and the announcement shows up with the colored background just like manual /announce commands.
Yeah, common mistake - IRC doesn’t support slash commands at all, even with mod perms. You’re just sending /announce as regular chat text, which obviously won’t work. Easiest fix is the Helix API endpoint for announcements, but you’ll need proper OAuth setup with channel:moderate scope first.