diff options
Diffstat (limited to 'src/commands/config')
-rw-r--r-- | src/commands/config/config.ts | 17 | ||||
-rw-r--r-- | src/commands/config/disable.ts | 4 | ||||
-rw-r--r-- | src/commands/config/log.ts | 10 |
3 files changed, 15 insertions, 16 deletions
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index adc41d8..4d38c54 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -13,8 +13,8 @@ import { type GuildSettingType, type SlashMessage } from '#lib'; +import { ExtSub, type ArgumentGeneratorReturn, type SlashOption } from '@notenoughupdates/discord-akairo'; import assert from 'assert/strict'; -import { type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo'; import { ActionRowBuilder, ApplicationCommandOptionType, @@ -32,10 +32,9 @@ import { User, type Message, type MessageComponentInteraction, - type MessageOptions + type MessageCreateOptions } from 'discord.js'; -import _ from 'lodash'; -const { camelCase, snakeCase } = _; +import { camelCase, snakeCase } from 'lodash-es'; export const arrayActions = ['view' as const, 'add' as const, 'remove' as const, 'clear' as const]; export type ArrayActions = typeof arrayActions[number]; @@ -79,7 +78,7 @@ export default class ConfigCommand extends BotCommand { description: `Manage the server's ${loweredName}`, type: ApplicationCommandOptionType.SubcommandGroup, options: isArray - ? [ + ? ([ { name: 'view', description: `View the server's ${loweredName}.`, @@ -118,8 +117,8 @@ export default class ConfigCommand extends BotCommand { description: `Remove all values from a server's ${loweredName}.`, type: ApplicationCommandOptionType.Subcommand } - ] - : [ + ] as ExtSub[]) + : ([ { name: 'view', description: `View the server's ${loweredName}.`, @@ -144,7 +143,7 @@ export default class ConfigCommand extends BotCommand { description: `Delete the server's ${loweredName}.`, type: ApplicationCommandOptionType.Subcommand } - ] + ] as ExtSub[]) }; }), channel: 'guild', @@ -309,7 +308,7 @@ export default class ConfigCommand extends BotCommand { public async generateMessageOptions( message: CommandMessage | SlashMessage, setting?: undefined | keyof typeof guildSettingsObj - ): Promise<MessageOptions & InteractionUpdateOptions> { + ): Promise<MessageCreateOptions & InteractionUpdateOptions> { assert(message.inGuild()); const settingsEmbed = new EmbedBuilder().setColor(colors.default); diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts index 6dd94a6..776ecf0 100644 --- a/src/commands/config/disable.ts +++ b/src/commands/config/disable.ts @@ -10,9 +10,9 @@ import { } from '#lib'; import assert from 'assert/strict'; import { ApplicationCommandOptionType, AutocompleteInteraction } from 'discord.js'; -import { default as Fuse } from 'fuse.js'; -assert(Fuse); +// todo: remove this bullshit once typescript gets its shit together +const Fuse = (await import('fuse.js')).default as unknown as typeof import('fuse.js').default; export default class DisableCommand extends BotCommand { private static blacklistedCommands = ['eval', 'disable']; diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts index 0c74ce7..6d0f594 100644 --- a/src/commands/config/log.ts +++ b/src/commands/config/log.ts @@ -8,8 +8,8 @@ import { type GuildLogType, type SlashMessage } from '#lib'; +import { ArgumentGeneratorReturn } from '@notenoughupdates/discord-akairo'; import assert from 'assert/strict'; -import { ArgumentGeneratorReturn } from 'discord-akairo'; import { ApplicationCommandOptionType, ChannelType } from 'discord.js'; export default class LogCommand extends BotCommand { @@ -38,10 +38,10 @@ export default class LogCommand extends BotCommand { slashType: ApplicationCommandOptionType.Channel, channelTypes: [ ChannelType.GuildText, - ChannelType.GuildNews, - ChannelType.GuildNewsThread, - ChannelType.GuildPublicThread, - ChannelType.GuildPrivateThread + ChannelType.GuildAnnouncement, + ChannelType.AnnouncementThread, + ChannelType.PublicThread, + ChannelType.PrivateThread ], only: 'slash' } |