make development commands silently error

This commit is contained in:
derpystuff 2023-04-01 14:02:58 +02:00
parent 575bbaa73a
commit 9fa0fb1ee4
4 changed files with 3 additions and 48 deletions

View file

@ -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)
}
},
}

View file

@ -20,10 +20,7 @@ module.exports = {
{ default: true, name: "async", type: "bool", help: "Async evaluation" } { default: true, name: "async", type: "bool", help: "Async evaluation" }
], ],
onBefore: context => context.user.isClientOwner, onBefore: context => context.user.isClientOwner,
onCancel: context => onCancel: ()=>{},
context.reply(
`${context.user.mention}, you are lacking the permission \`BOT_OWNER\`.`
),
run: async (context, args) => { run: async (context, args) => {
await context.triggerTyping(); await context.triggerTyping();
const { matches } = Utils.regex( const { matches } = Utils.regex(

View file

@ -11,10 +11,7 @@ module.exports = {
usage: 'reload' usage: 'reload'
}, },
onBefore: context => context.user.isClientOwner, onBefore: context => context.user.isClientOwner,
onCancel: context => onCancel: ()=>{},
context.reply(
`${context.user.mention}, you are lacking the permission \`BOT_OWNER\`.`
),
run: async (context) => { run: async (context) => {
await context.triggerTyping(); await context.triggerTyping();
const time = Date.now(); const time = Date.now();

View file

@ -17,10 +17,7 @@ module.exports = {
{ default: false, name: "force", type: "bool", help: "Force update" } { default: false, name: "force", type: "bool", help: "Force update" }
], ],
onBefore: context => context.user.isClientOwner, onBefore: context => context.user.isClientOwner,
onCancel: context => onCancel: ()=>{},
context.reply(
`${context.user.mention}, you are lacking the permission \`BOT_OWNER\`.`
),
run: async (context, args) => { run: async (context, args) => {
let response = await editOrReply(context, createEmbed("loading", context, "Updating bot...")) let response = await editOrReply(context, createEmbed("loading", context, "Updating bot..."))
try{ try{