From 9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 24 May 2022 18:29:57 -0400 Subject: fix: breaking changes --- src/commands/info/snowflake.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/commands/info/snowflake.ts') diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts index 71ae80d..933b1ac 100644 --- a/src/commands/info/snowflake.ts +++ b/src/commands/info/snowflake.ts @@ -1,6 +1,7 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; import { ApplicationCommandOptionType, + ChannelType, EmbedBuilder, PermissionFlagsBits, SnowflakeUtil, @@ -42,7 +43,7 @@ export default class SnowflakeCommand extends BushCommand { // Channel if (client.channels.cache.has(snowflake)) { const channel = client.channels.resolve(snowflake)!; - const channelInfo = [`**Type:** ${BushChannelType[channel.type]}`]; + const channelInfo = [`**Type:** ${BushChannelType[channel.type] ?? ChannelType[channel.type]}`]; if (channel.isDM()) { channelInfo.push( `**Recipient:** ${util.discord.escapeMarkdown(channel.recipient?.tag ?? '¯\\_(ツ)_/¯')} (${ @@ -66,7 +67,7 @@ export default class SnowflakeCommand extends BushCommand { ); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(channel.name)} \`[Channel]\``); } - snowflakeEmbed.addFields({ name: '» Channel Info', value: channelInfo.join('\n') }); + snowflakeEmbed.addFields([{ name: '» Channel Info', value: channelInfo.join('\n') }]); } // Guild @@ -80,7 +81,7 @@ export default class SnowflakeCommand extends BushCommand { `**Members:** ${guild.memberCount?.toLocaleString()}` ]; if (guild.icon) snowflakeEmbed.setThumbnail(guild.iconURL({ size: 2048 })!); - snowflakeEmbed.addFields({ name: '» Server Info', value: guildInfo.join('\n') }); + snowflakeEmbed.addFields([{ name: '» Server Info', value: guildInfo.join('\n') }]); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(guild.name)} \`[Server]\``); } @@ -90,7 +91,7 @@ export default class SnowflakeCommand extends BushCommand { const user: User = (client.users.cache.get(snowflake) ?? fetchedUser)!; const userInfo = [`**Name:** <@${user.id}> (${util.discord.escapeMarkdown(user.tag)})`]; if (user.avatar) snowflakeEmbed.setThumbnail(user.avatarURL({ size: 2048 })!); - snowflakeEmbed.addFields({ name: '» User Info', value: userInfo.join('\n') }); + snowflakeEmbed.addFields([{ name: '» User Info', value: userInfo.join('\n') }]); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(user.tag)} \`[User]\``); } @@ -102,7 +103,7 @@ export default class SnowflakeCommand extends BushCommand { `**Animated:** ${emoji.animated}` ]; if (emoji.url) snowflakeEmbed.setThumbnail(emoji.url); - snowflakeEmbed.addFields({ name: '» Emoji Info', value: emojiInfo.join('\n') }); + snowflakeEmbed.addFields([{ name: '» Emoji Info', value: emojiInfo.join('\n') }]); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(emoji.name ?? '¯\\_(ツ)_/¯')} \`[Emoji]\``); } @@ -118,7 +119,7 @@ export default class SnowflakeCommand extends BushCommand { `**Hex Color:** ${role.hexColor}` ]; if (role.color) snowflakeEmbed.setColor(role.color); - snowflakeEmbed.addFields({ name: '» Role Info', value: roleInfo.join('\n') }); + snowflakeEmbed.addFields([{ name: '» Role Info', value: roleInfo.join('\n') }]); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(role.name)} \`[Role]\``); } @@ -131,7 +132,7 @@ export default class SnowflakeCommand extends BushCommand { `**Process ID:** ${deconstructedSnowflake.processId}`, `**Increment:** ${deconstructedSnowflake.increment}` ]; - snowflakeEmbed.addFields({ name: '» Snowflake Info', value: snowflakeInfo.join('\n') }); + snowflakeEmbed.addFields([{ name: '» Snowflake Info', value: snowflakeInfo.join('\n') }]); return await message.util.reply({ embeds: [snowflakeEmbed] }); } -- cgit