const Discord = require('discord.js'); const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); const client = new Discord.Client({ intents: [ Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES, Discord.Intents.FLAGS.DIRECT_MESSAGES ], partials: [ 'MESSAGE', 'CHANNEL', 'REACTION' ] }); client.on("ready", ()=>{ console.log("Do \`...remove-commands\`"); }); client.on("messageCreate", message => { if(message.guild == null) { message.reply({content:'You can\'t do this in DMs',allowedMentions:{repliedUser:false}}); return; } if(message.content === "...remove-commands") { message.channel.guild.commands.set([]); message.reply({content:'Removed all guild commands from this guild',allowedMentions:{repliedUser:false}}); } }); rl.question('What is your bot token: ',answer=>{ console.log("Attempting to login using your bot token"); client.login(answer); rl.close(); });