Closed Xulai closed 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
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.
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
@lastplacer found the .then function so that the bot reacts to its own message.
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