mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
FriendlyError
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { TOKEN, OWNER, PREFIX, INVITE, CLEVS_KEY, CLEVS_USER, CLEVS_NICK } = process.env;
|
||||
const { CommandoClient } = require('discord.js-commando');
|
||||
const { CommandoClient, FriendlyError } = require('discord.js-commando');
|
||||
const client = new CommandoClient({
|
||||
commandPrefix: PREFIX,
|
||||
owner: OWNER,
|
||||
@@ -59,7 +59,10 @@ client.on('error', console.error);
|
||||
|
||||
client.on('warn', console.warn);
|
||||
|
||||
client.on('commandError', (command, err) => console.error(command, err));
|
||||
client.on('commandError', (command, err) => {
|
||||
if (err instanceof FriendlyError) return;
|
||||
console.error(command.name, err);
|
||||
});
|
||||
|
||||
client.on('message', async (msg) => {
|
||||
if (msg.author.bot) return;
|
||||
|
||||
Reference in New Issue
Block a user