mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-16 17:45:28 +10:00
return error when it occurs
This commit is contained in:
5
bot.js
5
bot.js
@@ -36,9 +36,8 @@ client.on(Events.MessageCreate, async (message) => {
|
|||||||
|
|
||||||
const command = commands.get(commandName);
|
const command = commands.get(commandName);
|
||||||
if (command) {
|
if (command) {
|
||||||
await command.execute(message, client, args).catch(async () => {
|
await command.execute(message, client, args).catch(async (e) => {
|
||||||
await message.reply('An error occurred while running that command.')
|
throw new Error(`Error executing ${commandName}: ${e.message}`);
|
||||||
throw new Error(`Error executing ${commandName}:`);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import {EmbedBuilder} from "@fluxerjs/core";
|
|||||||
const cmds = new Map();
|
const cmds = new Map();
|
||||||
|
|
||||||
cmds.set('member', {
|
cmds.set('member', {
|
||||||
alias: 'm',
|
|
||||||
description: enums.help.SHORT_DESC_MEMBER,
|
description: enums.help.SHORT_DESC_MEMBER,
|
||||||
async execute(message, client, args) {
|
async execute(message, client, args) {
|
||||||
const reply = await memberHelper.parseMemberCommand(message.author.id, args, message.attachments[0] ?? null);
|
const reply = await memberHelper.parseMemberCommand(message.author.id, args, message.attachments[0] ?? null).catch(async (e) => {
|
||||||
|
return await message.reply(e);
|
||||||
|
});
|
||||||
return await message.reply(reply);
|
return await message.reply(reply);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { db } from '../sequelize.js';
|
import { db } from '../sequelize.js';
|
||||||
import {enums} from "../enums.js";
|
import {enums} from "../enums.js";
|
||||||
import { loadImage } from "canvas";
|
import { loadImage } from "canvas";
|
||||||
import {EmptyResultError, InstanceError} from "sequelize";
|
import {EmptyResultError} from "sequelize";
|
||||||
|
|
||||||
const mh = {};
|
const mh = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user