diff options
Diffstat (limited to 'src/commands/utilities')
-rw-r--r-- | src/commands/utilities/calculator.ts | 4 | ||||
-rw-r--r-- | src/commands/utilities/decode.ts | 4 | ||||
-rw-r--r-- | src/commands/utilities/highlight-!.ts | 2 | ||||
-rw-r--r-- | src/commands/utilities/highlight-matches.ts | 2 | ||||
-rw-r--r-- | src/commands/utilities/highlight-show.ts | 4 | ||||
-rw-r--r-- | src/commands/utilities/price.ts | 10 | ||||
-rw-r--r-- | src/commands/utilities/reminders.ts | 2 | ||||
-rw-r--r-- | src/commands/utilities/suicide.ts | 4 | ||||
-rw-r--r-- | src/commands/utilities/viewRaw.ts | 6 | ||||
-rw-r--r-- | src/commands/utilities/wolframAlpha.ts | 4 |
10 files changed, 22 insertions, 20 deletions
diff --git a/src/commands/utilities/calculator.ts b/src/commands/utilities/calculator.ts index 75dc63f..1a9d352 100644 --- a/src/commands/utilities/calculator.ts +++ b/src/commands/utilities/calculator.ts @@ -1,6 +1,6 @@ import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; import assert from 'assert'; -import { ApplicationCommandOptionType, Embed } from 'discord.js'; +import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; import { evaluate } from 'mathjs'; assert(evaluate); @@ -31,7 +31,7 @@ export default class CalculatorCommand extends BushCommand { } public override async exec(message: BushMessage | BushSlashMessage, args: { expression: string }) { - const decodedEmbed = new Embed().addFields({ + const decodedEmbed = new EmbedBuilder().addFields({ name: '📥 Input', value: await util.inspectCleanRedactCodeblock(args.expression, 'mma') }); diff --git a/src/commands/utilities/decode.ts b/src/commands/utilities/decode.ts index 1d64145..978c1c6 100644 --- a/src/commands/utilities/decode.ts +++ b/src/commands/utilities/decode.ts @@ -1,6 +1,6 @@ import { AllowedMentions, BushCommand, type BushMessage } from '#lib'; import { type AkairoMessage } from 'discord-akairo'; -import { ApplicationCommandOptionType, Embed } from 'discord.js'; +import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; const encodingTypesArray = ['ascii', 'utf8', 'utf-8', 'utf16le', 'ucs2', 'ucs-2', 'base64', 'latin1', 'binary', 'hex']; const encodingTypesString = encodingTypesArray.map((e) => `\`${e}\``).join(', '); @@ -53,7 +53,7 @@ export default class DecodeCommand extends BushCommand { { from, to, data }: { from: BufferEncoding; to: BufferEncoding; data: string } ) { const encodeOrDecode = util.capitalizeFirstLetter(message?.util?.parsed?.alias ?? 'decoded'); - const decodedEmbed = new Embed() + const decodedEmbed = new EmbedBuilder() .setTitle(`${encodeOrDecode} Information`) .addFields({ name: '📥 Input', value: await util.inspectCleanRedactCodeblock(data) }); try { diff --git a/src/commands/utilities/highlight-!.ts b/src/commands/utilities/highlight-!.ts index 2ec1a29..2b18198 100644 --- a/src/commands/utilities/highlight-!.ts +++ b/src/commands/utilities/highlight-!.ts @@ -1,6 +1,6 @@ import { BushCommand, Highlight, HighlightWord, type BushSlashMessage } from '#lib'; import { Flag, type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo'; -import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { ApplicationCommandOptionType } from 'discord-api-types/v10'; import { ApplicationCommandSubCommandData, AutocompleteInteraction, CacheType } from 'discord.js'; type Unpacked<T> = T extends (infer U)[] ? U : T; diff --git a/src/commands/utilities/highlight-matches.ts b/src/commands/utilities/highlight-matches.ts index aa8308c..0e98c8d 100644 --- a/src/commands/utilities/highlight-matches.ts +++ b/src/commands/utilities/highlight-matches.ts @@ -1,7 +1,7 @@ import { BushCommand, ButtonPaginator, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; import assert from 'assert'; import { ArgumentGeneratorReturn } from 'discord-akairo'; -import { APIEmbed } from 'discord-api-types/v9'; +import { APIEmbed } from 'discord-api-types/v10'; import { highlightCommandArgs, highlightSubcommands } from './highlight-!.js'; export default class HighlightMatchesCommand extends BushCommand { diff --git a/src/commands/utilities/highlight-show.ts b/src/commands/utilities/highlight-show.ts index 7058675..1eb9fd0 100644 --- a/src/commands/utilities/highlight-show.ts +++ b/src/commands/utilities/highlight-show.ts @@ -1,6 +1,6 @@ import { AllowedMentions, BushCommand, Highlight, type BushMessage, type BushSlashMessage } from '#lib'; import assert from 'assert'; -import { Embed } from 'discord.js'; +import { EmbedBuilder } from 'discord.js'; import { highlightSubcommands } from './highlight-!.js'; export default class HighlightShowCommand extends BushCommand { @@ -28,7 +28,7 @@ export default class HighlightShowCommand extends BushCommand { if (!highlight.words.length) return message.util.reply(`${util.emojis.error} You are not highlighting any words.`); - const embed = new Embed() + const embed = new EmbedBuilder() .setTitle('Highlight List') .setDescription( highlight.words diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts index f6d1104..0117715 100644 --- a/src/commands/utilities/price.ts +++ b/src/commands/utilities/price.ts @@ -1,6 +1,6 @@ import { BushCommand, type BushMessage } from '#lib'; import assert from 'assert'; -import { ApplicationCommandOptionType, AutocompleteInteraction, Embed, PermissionFlagsBits } from 'discord.js'; +import { ApplicationCommandOptionType, AutocompleteInteraction, EmbedBuilder, PermissionFlagsBits } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; @@ -58,7 +58,7 @@ export default class PriceCommand extends BushCommand { ])) as [Bazaar | undefined, LowestBIN | undefined, LowestBIN | undefined, AuctionAverages | undefined]; let parsedItem = item.toString().toUpperCase().replace(/ /g, '_').replace(/'S/g, ''); - const priceEmbed = new Embed().setColor(errors?.length ? util.colors.warn : util.colors.success).setTimestamp(); + const priceEmbed = new EmbedBuilder().setColor(errors?.length ? util.colors.warn : util.colors.success).setTimestamp(); if (bazaar?.success === false) errors.push('bazaar'); @@ -104,10 +104,12 @@ export default class PriceCommand extends BushCommand { // checks if the item exists in any of the action information otherwise it is not a valid item if (currentLowestBIN?.[parsedItem] || averageLowestBIN?.[parsedItem] || auctionAverages?.[parsedItem]) { priceEmbed.setTitle(`Price Information for ${util.format.input(parsedItem)}`).setFooter({ - text: `${priceEmbed.footer?.text ? `${priceEmbed.footer.text} | ` : ''}All information is based on the last 3 days.` + text: `${ + priceEmbed.data.footer?.text ? `${priceEmbed.data.footer.text} | ` : '' + }All information is based on the last 3 days.` }); } else { - const errorEmbed = new Embed(); + const errorEmbed = new EmbedBuilder(); errorEmbed .setColor(util.colors.error) .setDescription( diff --git a/src/commands/utilities/reminders.ts b/src/commands/utilities/reminders.ts index 10206c1..653274a 100644 --- a/src/commands/utilities/reminders.ts +++ b/src/commands/utilities/reminders.ts @@ -1,6 +1,6 @@ import { BushCommand, ButtonPaginator, Reminder, type BushMessage, type BushSlashMessage } from '#lib'; import assert from 'assert'; -import { APIEmbed } from 'discord-api-types/v9'; +import { APIEmbed } from 'discord-api-types/v10'; import { PermissionFlagsBits } from 'discord.js'; import { Op } from 'sequelize'; diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts index be6730b..136de78 100644 --- a/src/commands/utilities/suicide.ts +++ b/src/commands/utilities/suicide.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; -import { Embed } from 'discord.js'; +import { EmbedBuilder } from 'discord.js'; export default class SuicideCommand extends BushCommand { public constructor() { @@ -18,7 +18,7 @@ export default class SuicideCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage) { // stolen from https://github.com/dexbiobot/Zeppelin - const suicideEmbed = new Embed() + const suicideEmbed = new EmbedBuilder() .setTitle('Mental Health Resources') .setColor(util.colors.red) .setAuthor({ diff --git a/src/commands/utilities/viewRaw.ts b/src/commands/utilities/viewRaw.ts index be79499..1da26f9 100644 --- a/src/commands/utilities/viewRaw.ts +++ b/src/commands/utilities/viewRaw.ts @@ -1,6 +1,6 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib'; import assert from 'assert'; -import { ApplicationCommandOptionType, ChannelType, Embed, Message, PermissionFlagsBits } from 'discord.js'; +import { ApplicationCommandOptionType, ChannelType, EmbedBuilder, Message, PermissionFlagsBits } from 'discord.js'; export default class ViewRawCommand extends BushCommand { public constructor() { @@ -88,7 +88,7 @@ export default class ViewRawCommand extends BushCommand { return await message.util.reply({ embeds: [Embed] }); } - public static async getRawData(message: BushMessage, options: { json?: boolean; js: boolean }): Promise<Embed> { + public static async getRawData(message: BushMessage, options: { json?: boolean; js: boolean }): Promise<EmbedBuilder> { const content = options.json || options.js ? options.json @@ -96,7 +96,7 @@ export default class ViewRawCommand extends BushCommand { : util.inspect(message.toJSON()) || '[No Content]' : message.content || '[No Content]'; const lang = options.json ? 'json' : options.js ? 'js' : undefined; - return new Embed() + return new EmbedBuilder() .setFooter({ text: message.author.tag, iconURL: message.author.avatarURL() ?? undefined }) .setTimestamp(message.createdTimestamp) .setColor(message.member?.roles?.color?.color ?? util.colors.default) diff --git a/src/commands/utilities/wolframAlpha.ts b/src/commands/utilities/wolframAlpha.ts index 948aec6..95df5e8 100644 --- a/src/commands/utilities/wolframAlpha.ts +++ b/src/commands/utilities/wolframAlpha.ts @@ -1,7 +1,7 @@ import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; import { initializeClass as WolframAlphaAPI } from '@notenoughupdates/wolfram-alpha-api'; import assert from 'assert'; -import { ApplicationCommandOptionType, Embed, type MessageOptions } from 'discord.js'; +import { ApplicationCommandOptionType, EmbedBuilder, type MessageOptions } from 'discord.js'; assert(WolframAlphaAPI); @@ -45,7 +45,7 @@ export default class WolframAlphaCommand extends BushCommand { args.image && void message.util.reply({ content: `${util.emojis.loading} Loading...`, embeds: [] }); const waApi = WolframAlphaAPI(client.config.credentials.wolframAlphaAppId); - const decodedEmbed = new Embed().addFields({ + const decodedEmbed = new EmbedBuilder().addFields({ name: '📥 Input', value: await util.inspectCleanRedactCodeblock(args.expression) }); |