aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/snowflake.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-24 18:29:57 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-24 18:29:57 -0400
commit9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c (patch)
tree4b95a06ff6991207ab8b8e93f0bca26e24a97f80 /src/commands/info/snowflake.ts
parent6b8115ab1ec94d4330019fc7a93e094d9d64c48e (diff)
downloadtanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.gz
tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.bz2
tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.zip
fix: breaking changes
Diffstat (limited to 'src/commands/info/snowflake.ts')
-rw-r--r--src/commands/info/snowflake.ts15
1 files changed, 8 insertions, 7 deletions
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] });
}