Integration into Discord

I am new to coding and dev., but I am building my first Discord bot.

That being said, I am looking for a way to integrate Twitch into my server and track members that have their Twitch account linked and a specified role, the bot will post when they go live.

Any assistance in this will be greatly appreciated.

You can’t.

The Discord API prevents bots being able to read “third party accounts”.

So you’d have to ask users to authenticate their Discord account in order to read that.

Which makes your question a Discord API question, not a Twitch API question.

Even if the user has already authenticated their twitch acct to discord?

Not sure what else to tell you here

Actually, if your goal is to detect if someone goes live on their Twitch channel and then react to this (give a “live” role, shoutout/post into a channel about it), you can do this.

The Discord API fires an event when a user status changes, and there’s a special status “live” (instead of “playing” when it’s shown what game you currently play) and the title of the stream.
You can check for this status change and then act upon it.

// EDIT:
This only works, though, when the user has “streamer mode” in Discord enabled, as otherwise the status will not change to “live”.

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