feat: add ignore command logic to shouldUpload method (#292)

This commit is contained in:
JustEvil 2024-11-07 10:45:10 -06:00 committed by GitHub
parent 136262f989
commit 6c31dc0301
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@ import {
} from '../types'; } from '../types';
import { Command, type CommandOption, SubCommand } from './applications/chat'; import { Command, type CommandOption, SubCommand } from './applications/chat';
import { ContextMenuCommand } from './applications/menu'; import { ContextMenuCommand } from './applications/menu';
import type { UsingClient } from './applications/shared'; import { IgnoreCommand, type UsingClient } from './applications/shared';
export class CommandHandler extends BaseHandler { export class CommandHandler extends BaseHandler {
values: (Command | ContextMenuCommand)[] = []; values: (Command | ContextMenuCommand)[] = [];
@ -170,7 +170,9 @@ export class CommandHandler extends BaseHandler {
async shouldUpload(file: string, guildId?: string) { async shouldUpload(file: string, guildId?: string) {
const values = this.values.filter(x => { const values = this.values.filter(x => {
if ('ignore' in x && x.ignore === IgnoreCommand.Slash) return false;
if (!guildId) return !x.guildId; if (!guildId) return !x.guildId;
return x.guildId?.includes(guildId); return x.guildId?.includes(guildId);
}); });
if ( if (