From 9fa0fb1ee40b63abd115b908d46cf46d210d16e2 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Sat, 1 Apr 2023 14:02:58 +0200 Subject: [PATCH] make development commands silently error --- commands/message/dev/debug/test.js | 36 ------------------------------ commands/message/dev/eval.js | 5 +---- commands/message/dev/reload.js | 5 +---- commands/message/dev/update.js | 5 +---- 4 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 commands/message/dev/debug/test.js diff --git a/commands/message/dev/debug/test.js b/commands/message/dev/debug/test.js deleted file mode 100644 index ae58c2a..0000000 --- a/commands/message/dev/debug/test.js +++ /dev/null @@ -1,36 +0,0 @@ -const { createEmbed } = require("../../../../labscore/utils/embed"); -const { editOrReply } = require("../../../../labscore/utils/message"); -const { flag } = require("../../../../service/makesweet"); -const { getRecentImage } = require("../../../../labscore/utils/attachment"); - -module.exports = { - name: 'test', - label: 'text', - metadata: { - description: 'test', - description_short: 'Bot test', - examples: ['test'], - category: 'dev', - usage: 'test' - }, - args: [ - { default: false, name: "noreply", type: "bool", help: "Should this command return the output?" }, - { default: 2, name: "jsonspacing", type: "number", help: "JSON spacing sizes" }, - { default: true, name: "async", type: "bool", help: "Compute async?" } - ], - run: async (context, args) => { - if(context.user.id !== "223518178100248576") return; - let image = await getRecentImage(context, 50) - if(!image) return editOrReply(context, { embeds: [createEmbed("warning", context, "No images found.")] }) - if(!args.text) args.text = "" - try { - let mkswt = await flag(image) - return editOrReply(context, { content:"ww", files: [{ - filename: "makesweet.gif", - value: mkswt.body - }] }) - } catch (e) { - console.log(e) - } - }, -} \ No newline at end of file diff --git a/commands/message/dev/eval.js b/commands/message/dev/eval.js index 0e97f64..e2fafed 100644 --- a/commands/message/dev/eval.js +++ b/commands/message/dev/eval.js @@ -20,10 +20,7 @@ module.exports = { { default: true, name: "async", type: "bool", help: "Async evaluation" } ], onBefore: context => context.user.isClientOwner, - onCancel: context => - context.reply( - `${context.user.mention}, you are lacking the permission \`BOT_OWNER\`.` - ), + onCancel: ()=>{}, run: async (context, args) => { await context.triggerTyping(); const { matches } = Utils.regex( diff --git a/commands/message/dev/reload.js b/commands/message/dev/reload.js index fb70063..f7f5b18 100644 --- a/commands/message/dev/reload.js +++ b/commands/message/dev/reload.js @@ -11,10 +11,7 @@ module.exports = { usage: 'reload' }, onBefore: context => context.user.isClientOwner, - onCancel: context => - context.reply( - `${context.user.mention}, you are lacking the permission \`BOT_OWNER\`.` - ), + onCancel: ()=>{}, run: async (context) => { await context.triggerTyping(); const time = Date.now(); diff --git a/commands/message/dev/update.js b/commands/message/dev/update.js index 44836e0..7fd9ce6 100644 --- a/commands/message/dev/update.js +++ b/commands/message/dev/update.js @@ -17,10 +17,7 @@ module.exports = { { default: false, name: "force", type: "bool", help: "Force update" } ], onBefore: context => context.user.isClientOwner, - onCancel: context => - context.reply( - `${context.user.mention}, you are lacking the permission \`BOT_OWNER\`.` - ), + onCancel: ()=>{}, run: async (context, args) => { let response = await editOrReply(context, createEmbed("loading", context, "Updating bot...")) try{