aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/snowflakeInfo.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-17 12:31:09 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-17 12:31:09 -0400
commitd40527d0a2d9f209905750258f71bedff1cdf089 (patch)
treee017fd844c2135bfc85228d00ef2617d24ce0a3f /src/commands/info/snowflakeInfo.ts
parentd431ad00754f3f250103deedea495b9bcee73fc0 (diff)
downloadtanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz
tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2
tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip
turned on ts strict option
Diffstat (limited to 'src/commands/info/snowflakeInfo.ts')
-rw-r--r--src/commands/info/snowflakeInfo.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/commands/info/snowflakeInfo.ts b/src/commands/info/snowflakeInfo.ts
index f293219..c4d71da 100644
--- a/src/commands/info/snowflakeInfo.ts
+++ b/src/commands/info/snowflakeInfo.ts
@@ -58,7 +58,7 @@ export default class SnowflakeInfoCommand extends BushCommand {
// Channel
if (client.channels.cache.has(snowflake)) {
- const channel: Channel = client.channels.cache.get(snowflake);
+ const channel: Channel = client.channels.cache.get(snowflake)!;
const channelInfo = [`**Type:** ${channel.type}`];
if (['dm', 'group'].includes(channel.type)) {
const _channel = channel as DMChannel;
@@ -89,38 +89,38 @@ export default class SnowflakeInfoCommand extends BushCommand {
// Guild
else if (client.guilds.cache.has(snowflake)) {
- const guild: Guild = client.guilds.cache.get(snowflake);
+ const guild: Guild = client.guilds.cache.get(snowflake)!;
const guildInfo = [
`**Name:** ${guild.name}`,
- `**Owner:** ${client.users.cache.get(guild.ownerId)?.tag || '¯\\_(ツ)_/¯'} (${guild.ownerId})`,
+ `**Owner:** ${client.users.cache.get(guild.ownerId)?.tag ?? '¯\\_(ツ)_/¯'} (${guild.ownerId})`,
`**Members:** ${guild.memberCount?.toLocaleString()}`
];
- snowflakeEmbed.setThumbnail(guild.iconURL({ size: 2048, dynamic: true }));
+ if (guild.icon) snowflakeEmbed.setThumbnail(guild.iconURL({ size: 2048, dynamic: true })!);
snowflakeEmbed.addField('» Server Info', guildInfo.join('\n'));
snowflakeEmbed.setTitle(`:snowflake: ${guild.name} \`[Server]\``);
}
// User
else if (client.users.cache.has(snowflake)) {
- const user: User = client.users.cache.get(snowflake);
+ const user: User = client.users.cache.get(snowflake)!;
const userInfo = [`**Name:** <@${user.id}> (${user.tag})`];
- snowflakeEmbed.setThumbnail(user.avatarURL({ size: 2048, dynamic: true }));
+ if (user.avatar) snowflakeEmbed.setThumbnail(user.avatarURL({ size: 2048, dynamic: true })!);
snowflakeEmbed.addField('» User Info', userInfo.join('\n'));
snowflakeEmbed.setTitle(`:snowflake: ${user.tag} \`[User]\``);
}
// Emoji
else if (client.emojis.cache.has(snowflake)) {
- const emoji: Emoji = client.emojis.cache.get(snowflake);
+ const emoji: Emoji = client.emojis.cache.get(snowflake)!;
const emojiInfo = [`**Name:** ${emoji.name}`, `**Animated:** ${emoji.animated}`];
- snowflakeEmbed.setThumbnail(emoji.url);
+ if (emoji.url) snowflakeEmbed.setThumbnail(emoji.url);
snowflakeEmbed.addField('» Emoji Info', emojiInfo.join('\n'));
snowflakeEmbed.setTitle(`:snowflake: ${emoji.name} \`[Emoji]\``);
}
// Role
- else if (message.guild.roles.cache.has(snowflake)) {
- const role: Role = message.guild.roles.cache.get(snowflake);
+ else if (message.guild && message.guild.roles.cache.has(snowflake)) {
+ const role: Role = message.guild.roles.cache.get(snowflake)!;
const roleInfo = [
`**Name:** <@&${role.id}> (${role.name})`,
`**Members:** ${role.members.size}`,