Advertisement
Guest User

code

a guest
Sep 19th, 2018
74
0
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. let id = JSON.parse(fs.readFileSync("./ids.json", "utf8"));
  4.  
  5. module.exports.run = async (bot, message, args) => {
  6.   if(!message.member.hasPermission("ADMINISTRATOR")) return message.reply("관리자 권한이 필요합니다 (2)");
  7.   let addchannel = message.channel(message.mentions.channels.first()) || message.guild.channels.get(args[0])
  8.   if(!addchannel) return message.reply("Couldn't find");
  9.  
  10.   if(!id[addchannel.id]) warnsa[addchannel.id] = {
  11.     id: message.channel.id
  12.   };
  13.  
  14.   id[addchannel.id].warns = id[addchannel.id].warns + 1;
  15.  
  16.   fs.writeFile("./ids.json", JSON.stringify(addchannel.id), (err) => {
  17.     if (err) console.log(err)
  18.   });
  19.  
  20.   let channelEmbed = new Discord.RichEmbed()
  21.   .setTitle("Notification settings")
  22.   .setAuthor(message.author.username)
  23.   .setColor("#fc6400")
  24.   .addField("Channel", `${message.channel}`)
  25.   message.channel.send(channelEmbed);
  26. }
  27.  
  28. module.exports.help = {
  29.   name: "debug.addid"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement