Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const fs = require("fs");
  3.  
  4. module.exports.run = async (bot, message, args) => {
  5.  
  6. if(!message.member.hasPermission("administrator")) return message.reply("you do not have the correct permissions to use this command!");
  7. if(!args[0] || args[0 == "help"]) return message.reply("Usage: !changetester <open/close>");
  8.  
  9. let apps = JSON.parse(fs.readFileSync("./application.json", "utf8"));
  10.  
  11. apps[message.guild.id] = {
  12. apps: args[0]
  13. };
  14.  
  15. fs.writeFile("./application.json", JSON.stringify(apps), (err) => {
  16. if (err) console.log(err)
  17. });
  18.  
  19. let sEmbed = new Discord.RichEmbed()
  20. .setColor("#FF9900")
  21. .setTitle("Tester application system")
  22. .setDescription(`application are now ${args[0]}!`);
  23.  
  24. message.channel.send(sEmbed);
  25.  
  26. }
  27.  
  28. module.exports.help = {
  29. name: "changetester"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement