forked from Supositware/Haha-Yes
Show error message
This commit is contained in:
parent
fe014ca7d7
commit
d96d32f008
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
// TODO: Moving that to a dedicated function that works for both messages and interactions
|
||||||
|
|
||||||
import { PermissionFlagsBits, InteractionType } from 'discord.js';
|
import { PermissionFlagsBits, InteractionType } from 'discord.js';
|
||||||
import db from '../../models/index.js';
|
import db from '../../models/index.js';
|
||||||
import ratelimiter from '../../utils/ratelimiter.js';
|
import ratelimiter from '../../utils/ratelimiter.js';
|
||||||
|
@ -114,7 +116,7 @@ export default {
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
|
await interaction.followUp({ content: `There was an error while executing this command!\n\`${error}\``, ephemeral: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -253,6 +253,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command handling from message
|
// Command handling from message
|
||||||
|
// TODO: Moving that to a dedicated function that works for both messages and interactions
|
||||||
|
|
||||||
let hasPrefix = false;
|
let hasPrefix = false;
|
||||||
prefixs.forEach(p => {
|
prefixs.forEach(p => {
|
||||||
|
@ -440,7 +441,11 @@ export default {
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await message.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
await message.reply({ content: `There was an error while executing this command!\n\`${error}\`` })
|
||||||
|
.catch(async () => {
|
||||||
|
await message.channel.send({ content: `There was an error while executing this command!\n\`${error}\`` });
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue