Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const client = new Discord.Client();
- const hexId = '198106489917931520';
- client.on("ready", () => {
- console.log("I am ready!");
- });
- client.on("message", (message) => {
- /* Don't reply if the sender is a bot. */
- if (message.author.bot) {
- return;
- }
- /* Get whether or not the message mentions Hex. null if false, hex's id if true. */
- const foundHexKey = message.mentions.members.findKey((value) => {
- return (value.id === hexId);
- });
- const mentionsHex = (foundHexKey === hexId);
- /* Check if the message mentions hex. */
- if (mentionsHex) {
- message.channel.send('You cannot just ping the admin!');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement