From 840cca672d681c36f980a06fb79a4e2c01bd69ac Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 25 Jan 2022 23:47:40 -0500 Subject: I love breaking changes!!!! --- src/commands/config/config.ts | 12 ++++++++---- src/commands/config/features.ts | 6 +++--- src/commands/config/log.ts | 14 ++++++++++---- 3 files changed, 21 insertions(+), 11 deletions(-) (limited to 'src/commands/config') diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts index 41bdc04..42ff309 100644 --- a/src/commands/config/config.ts +++ b/src/commands/config/config.ts @@ -16,9 +16,10 @@ import { ButtonComponent, ButtonStyle, Channel, + Embed, Formatters, GuildMember, - MessageEmbed, + InteractionUpdateOptions, Permissions, Role, SelectMenuComponent, @@ -286,9 +287,9 @@ export default class ConfigCommand extends BushCommand { public async generateMessageOptions( message: BushMessage | BushSlashMessage, setting?: undefined | keyof typeof guildSettingsObj - ): Promise { + ): Promise { if (!message.guild) throw new Error('message.guild is null'); - const settingsEmbed = new MessageEmbed().setColor(util.colors.default); + const settingsEmbed = new Embed().setColor(util.colors.default); if (!setting) { settingsEmbed.setTitle(`${message.guild!.name}'s Settings`); const desc = settingsArr.map((s) => `:wrench: **${guildSettingsObj[s].name}**`).join('\n'); @@ -364,7 +365,10 @@ export default class ConfigCommand extends BushCommand { message.util.isSlash ? _.snakeCase(setting) : setting } ${guildSettingsObj[setting].type.includes('-array') ? 'add/remove' : 'set'} " to set this setting.` }); - settingsEmbed.addField('value', (await generateCurrentValue(guildSettingsObj[setting].type)) || '[No Value Set]'); + settingsEmbed.addField({ + name: 'value', + value: (await generateCurrentValue(guildSettingsObj[setting].type)) || '[No Value Set]' + }); return { embeds: [settingsEmbed], components: [components] }; } } diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts index fdd6c1e..04c0425 100644 --- a/src/commands/config/features.ts +++ b/src/commands/config/features.ts @@ -9,7 +9,7 @@ import { import { ActionRow, ComponentType, - MessageEmbed, + Embed, Permissions, SelectMenuComponent, SelectMenuOption, @@ -35,7 +35,7 @@ export default class FeaturesCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage) { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be used in servers.`); - const featureEmbed = new MessageEmbed().setTitle(`${message.guild!.name}'s Features`).setColor(util.colors.default); + const featureEmbed = new Embed().setTitle(`${message.guild!.name}'s Features`).setColor(util.colors.default); const enabledFeatures = await message.guild!.getSetting('enabledFeatures'); this.generateDescription(guildFeaturesArr, enabledFeatures, featureEmbed); @@ -71,7 +71,7 @@ export default class FeaturesCommand extends BushCommand { }); } - public generateDescription(allFeatures: GuildFeatures[], currentFeatures: GuildFeatures[], embed: MessageEmbed): void { + public generateDescription(allFeatures: GuildFeatures[], currentFeatures: GuildFeatures[], embed: Embed): void { embed.setDescription( allFeatures .map( diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts index 5906623..4c9a20b 100644 --- a/src/commands/config/log.ts +++ b/src/commands/config/log.ts @@ -1,6 +1,6 @@ import { BushCommand, guildLogsArr, type ArgType, type BushMessage, type BushSlashMessage, type GuildLogType } from '#lib'; -import { type ArgumentOptions, type Flag } from 'discord-akairo'; -import { ApplicationCommandOptionType, Permissions } from 'discord.js'; +import { ArgumentGeneratorReturn } from 'discord-akairo'; +import { ApplicationCommandOptionType, ChannelType, Permissions } from 'discord.js'; export default class LogCommand extends BushCommand { public constructor() { @@ -26,7 +26,13 @@ export default class LogCommand extends BushCommand { type: 'channel', prompt: 'What channel would you like these logs to be sent in?', slashType: ApplicationCommandOptionType.Channel, - channelTypes: ['GuildText', 'GuildNews', 'GuildNewsThread', 'GuildPublicThread', 'GuildPrivateThread'], + channelTypes: [ + ChannelType.GuildText, + ChannelType.GuildNews, + ChannelType.GuildNewsThread, + ChannelType.GuildPublicThread, + ChannelType.GuildPrivateThread + ], only: 'slash' } ], @@ -36,7 +42,7 @@ export default class LogCommand extends BushCommand { }); } - public override *args(): IterableIterator { + public override *args(): ArgumentGeneratorReturn { const log_type = yield { id: 'log_type', type: guildLogsArr, -- cgit