0
votes

I'm working with discord.js and with my bot, I've been trying to make it react with random emojis whenever someone sends a message. This is what I have so far with some lines commented because I don't know what to do with them. (I'm using custom emojis)

top:

var emojisnop = [":vibing:698328721383227392",":snoopy5:724412122703855747",":snoopy4:724411949281968131",":snoopy3:724411826430804018",":snoopy2:724411667106103437"];

bottom:

bot.on('message', message => {
    if (message) {
    return emojisnop = emojisnop[Math.floor(Math.random() * emojisnop.length)]
        message.react(':vibing:698328721383227392')
    }
});

Any help would be wonderful

2

2 Answers

1
votes
var emojisnop = ["698328721383227392","724412122703855747","724411949281968131","724411826430804018","724411667106103437"];

bot.on('message', message => {
    if (message) {
    return emojisnop = emojisnop[Math.floor(Math.random() * emojisnop.length)]
        message.react(emojisnop)
    }
});

For custom emojis use emoji ID

0
votes

Top:

var emojisnop = [":vibing:698328721383227392",":snoopy5:724412122703855747",":snoopy4:724411949281968131",":snoopy3:724411826430804018",":snoopy2:724411667106103437"];
var emojirandom

bottom:

bot.on('message', message => {
    if (message) {
      emojirandom = emojisnop[Math.floor(Math.random() * emojisnop.length)]
        message.react(emojirandom)
    }
});