0

I'm currently writing a discord bot for fun for a server I'm in, and I thought it would be fun to have the bot be able to tell you todays PogChamp emote. I've messed around with Twitch's API and TwitchEmotes API but I still haven't found a way to do it, as it seems the only way to search emotes is by their ID, which changes daily for PogChamp as it is coded as a totally new emote every day. I'm newish to javascript and Node.js, but any suggestions would be apprecieated!

1 Answers1

0

Bot A connects to chat Bot B connects to chat

Bot A sends a PogChamp to it's own Channel Bot B reads the chat and checks if the EmoteID (from the Emotes tag) has changed.

Both bots shut down.

If it has new PogChamp!

Bot B can be a clone of Bot A using the same credentials or read only credentials

@badge-info=;badges=global_mod/1,turbo/1;color=#0D4200;display-name=ronni;emotes=25:0-4,12-16/1902:6-10;id=b34ccfc7-4977-403a-8a94-33c6bac34fb8;mod=0;room-id=1337;subscriber=0;tmi-sent-ts=1507246572675;turbo=1;user-id=1337;user-type=global_mod :ronni!ronni@ronni.tmi.twitch.tv PRIVMSG #ronni :Kappa Keepo Kappa

So you'd read/parse for the emotes in the IRCv3 tags which is of the format

emotes=emoteID:startIndicy:endIndicy

startIndicy:endIndicy is repeated for each instance of the emote in a message

emoteID:startIndicy:endIndicy is repeated for each emote in the message.

But if you send only one PogChamp you don't need to worry about multiple instances of the tag.

Source docs: https://dev.twitch.tv/docs/irc/tags#privmsg-twitch-tags

Also note: Twitch is no longer rotating PogChamps.

Barry Carlyon
  • 1,039
  • 9
  • 13