Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client();
  3.  
  4. const hexId = '198106489917931520';
  5.  
  6. client.on("ready", () => {
  7. console.log("I am ready!");
  8. });
  9.  
  10. client.on("message", (message) => {
  11. /* Don't reply if the sender is a bot. */
  12. if (message.author.bot) {
  13. return;
  14. }
  15.  
  16. /* Get whether or not the message mentions Hex. null if false, hex's id if true. */
  17. const foundHexKey = message.mentions.members.findKey((value) => {
  18. return (value.id === hexId);
  19. });
  20. const mentionsHex = (foundHexKey === hexId);
  21.  
  22. /* Check if the message mentions hex. */
  23. if (mentionsHex) {
  24. message.channel.send('You cannot just ping the admin!');
  25. }
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement