Ledger Nano X - The secure hardware wallet
SHARE
TWEET

warns.js

UndercoverNL May 21st, 2020 (edited) 1,073 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const discord = require("discord.js");
  2. const fs = require("fs");
  3. const ms = require("ms");
  4. const warns = JSON.parse(fs.readFileSync("./warnings.json", "utf8"));
  5.  
  6. exports.run = async (client, message, args) => {
  7.    
  8.     if(!message.member.hasPermissions("MANAGE_MESSAGES")) return message.channel.send("You do not have permission for this command!");
  9.    
  10.     let wUser = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0])
  11.     if(!wUser) return message.channel.send("Please enter a valid user!");
  12.     var warns = JSON.parse(fs.readFileSync(`./warnings.json`))
  13.  
  14.      try {
  15.     return message.channel.send(`${wUser.user.username} has ${warns[wUser.id].warns} warning(s)`);
  16.     } catch (error) {
  17.         message.channel.send(`${wUser.user.username} has 0 warnings`);
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top