From d8ed1b417353b0470b6f8388ea01592e27087adf Mon Sep 17 00:00:00 2001 From: Ecolipsy Date: Tue, 23 Nov 2021 18:41:11 +0100 Subject: [PATCH] Added global support and startglobal script --- index.js | 5 ++++- start | 2 +- startglobal | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 startglobal diff --git a/index.js b/index.js index bb0fd34..019b04c 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,9 @@ function stopLoop(){ client.on("ready", () => { startLoop(); console.log("I'm alive"); - client.guilds.cache.get("879081086817288264").commands.set([ + var obj = client.application.commands; + if(process.argv[2]) obj = client.guilds.cache.get("879081086817288264").commands; + obj.set([ { name: "ping", description: "Am alive???" @@ -141,6 +143,7 @@ client.on("interactionCreate", (int) => { int.reply(e.stack).catch(e => {}); }; } else if(int.commandName == "kick"){ + if(!int.guild) return int.reply("This command cannot be used outside a guild."); var mem = int.guild.members.cache.get(int.user.id); if(!mem.permissions.has("KICK_MEMBERS")) return int.reply("You tried kicking without perms? You're sus"); var mem2 = int.guild.members.cache.get(int.options.getUser("user").id); diff --git a/start b/start index 14b5991..227c82b 100755 --- a/start +++ b/start @@ -1,4 +1,4 @@ while [ true ] do - node . + node . 879081086817288264 done diff --git a/startglobal b/startglobal new file mode 100644 index 0000000..c143f0f --- /dev/null +++ b/startglobal @@ -0,0 +1,4 @@ +while [ true ] +do + node . +done \ No newline at end of file