const Discord = require("discord.js"); const TOKEN = require("./token.js"); const client = new Discord.Client(); const PING_EMOTES_COUNT = 7; function getPingEmoteId() { return Math.floor(Math.random() * PING_EMOTES_COUNT); } client.on("ready", () => { console.log("Ready!"); }); client.on("message", m => { if (m.mentions.users.some(u => u.id == client.user.id)) { const emote = `AngeryPing${getPingEmoteId()}`; m.channel.send(client.emojis.find(e => e.name == emote).toString()); } else if (m.content.includes("Noct")) { m.channel.send(client.emojis.find("name", "mukuNeighWaaaaaa").toString()); } }); client.login(TOKEN);