Discord - Get Reactions on Post

Hello,

I want to Programm a Discord Game, where people have 10 Minutes to add a reaction to a post. After this I want to pick a random user from the reactions.

Is this some how possible with current methods?

Thanks

you would need something like this then pull a list of people in that database after the ammount of time

     /**
     * @event discordMessageReaction
     */
    $.bind('discordMessageReaction', function (event) {
        var reactionEvent = event.getEvent(),
            reactionUser = reactionEvent.getUser(),
            reactionType = event.getType(),
            reaction = reactionEvent.getReaction(),
            messageID = reaction.getMessage().getStringID(),
            messageEmoji = reaction.getEmoji();

        channelMessage = $.getSetIniDbString('rulesSettings', 'channelMessage');
        $.consoleDebug('reactionUser: ' + reactionUser.getStringID() + ' reactionType: ' + reactionType + ' channelMessage: ' + channelMessage + ' messageID: ' + messageID + ' messageEmoji: ' + messageEmoji.getStringID());
        if (channelMessage == messageID) {
            if (messageEmoji.getStringID() == 581627730328682497) {
                switch (String(reactionType).toLowerCase()) {
                    case 'add':
                        //ADD THEM TO DATABASE
                        break;
                    case 'remove':
                        //REMOVE THEM FROM DATABASE
                        break;
                    default:
                        //REMOVE THEM FROM DATABASE
                }
            }
        }
    });

okay I will give it a try with the binding :slight_smile: thank you

Works fine :slight_smile: Thank you.

Do you know how to add an emote to the message, so it’s easier for the users to just click on it, instead of the first one have to search for it?

an emote to the message? to get the emogi ID do \:emogi:

var readRules = $.say('message goes in here')
var xEmoji = ReactionEmoji.of(':AcceptRules:581627730328682497');
$.discordAPI.addReaction(readRules, xEmoji);

Thanks :slight_smile: That’s all I needed. Thats very cool. You helped me a lot.

i use this system for click me