Discord - Twitch question?

de
- in Twitch
1

I'm on an important project right now. I need an answer urgently and preferably quickly, and since you can always be relied on, I hope you can help me. I'm currently programming a Discord bot which, if a Twitch streamer should be online, should give it a live rank.

I now need an automatic system so that people who have a certain role in discord are automatically added to the request whether they are live.

+

That this bot checks every minute to see if people are streaming and updated without the console being open. Is that even possible and if so, how?

ro

The best thing to do is to use the "userUpdate" event and see whether the "presence" has changed to LIVE, then you check whether the user already has the group and take your next steps.

https://discord.js.org/#/docs/main/stable/class/User?scrollTo=presence

https://discord.js.org/#/docs/main/stable/class/Presence

The bot must of course be started for this.