zmoin / slapBot

a bot that slaps people on discord
1 stars 1 forks source link

Make the bot add reactions to command messages #7

Closed Xulai closed 5 years ago

Xulai commented 5 years ago

It is possible to get the bot to leave a react on messages. https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=react Get the bot to react to command messages with a thumbs up or smiley face or something.

To further expand on the idea, I've included a package called chance.js you could use this to pick a random emoji. https://chancejs.com/helpers/pickone.html

zmoin commented 5 years ago

We could do that. However, even if the bot randomises an emoji, can we specifically choose which emojis to choose from? @Xulai

Xulai commented 5 years ago

Yes. you could have an additional argument to specifically pick one. Or you could have a switch of emojis and use the weighted functions in chance.js to pick one of your selections randomly. You could even grab the id/username of the message sender and do an emoji reaction based on who they are.

zmoin commented 5 years ago

For now I have a function generateEmoji to that uses chance to pick a random emoji from an array. I'll push it for now until I find a better way to do this @Xulai

zmoin commented 5 years ago

@lastplacer found the .then function so that the bot reacts to its own message.