small fixes
This commit is contained in:
parent
963b401283
commit
2e5854b584
@ -33,7 +33,6 @@ class PruneInfraction extends Infraction {
|
||||
|
||||
async execute() {
|
||||
|
||||
console.log('executing');
|
||||
const { amount, message } = this.data;
|
||||
let messages = await this.fetchMessages(message, amount); //Collection, not array.
|
||||
if (messages.size === 0) return this._fail('C_PRUNE_NOTFETCHED');
|
||||
@ -74,7 +73,7 @@ class PruneInfraction extends Infraction {
|
||||
}
|
||||
};
|
||||
|
||||
await bulkDelete(messages.array());
|
||||
await bulkDelete(messages.map((msg) => msg));
|
||||
return amount;
|
||||
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class UnbanInfraction extends Infraction {
|
||||
|
||||
let ban = null;
|
||||
try {
|
||||
ban = await this.guild.fetchBan(this.target.id);
|
||||
ban = await this.guild.bans.fetch(this.target.id);
|
||||
} catch (e) {
|
||||
if (e.code !== 10026) this.client.logger.error(e);
|
||||
}
|
||||
|
@ -136,8 +136,6 @@ class CommandHandler extends Observer {
|
||||
// Find the option through the subcommand incase the subcommands have options with the same name
|
||||
const _subcommand = command.subcommand(subcommand?.name) || command;
|
||||
|
||||
// btw d.js already takes care of this, we don't need to do our own value parsing
|
||||
// unless we want to add support for custom stuff
|
||||
for (const option of interaction.optionsWithoutSubcommands) { // iterate through the received options
|
||||
|
||||
const matched = _subcommand.options.find((o) => o.name === option.name);
|
||||
|
@ -55,10 +55,12 @@ class ModerationCommand extends SlashCommand {
|
||||
|
||||
super(client, {
|
||||
...opts,
|
||||
options: [
|
||||
...baseOptions,
|
||||
...opts.options || []
|
||||
]
|
||||
options: opts.overrideOptions ?
|
||||
opts.options :
|
||||
[
|
||||
...baseOptions,
|
||||
...opts.options || []
|
||||
]
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class SlashCommand extends Command {
|
||||
* @memberof SlashCommand
|
||||
*/
|
||||
constructor(client, options = {}) {
|
||||
if (!options) return null;
|
||||
if (!options) throw new Error('Slash command missing defining options');
|
||||
if (!options.description?.length) throw new Error(`Slash commands MUST have a description: ${options.name}`);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user