diff options
Diffstat (limited to 'src/commands/info')
-rw-r--r-- | src/commands/info/snowflake.ts | 10 | ||||
-rw-r--r-- | src/commands/info/userInfo.ts | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts index c64a286..d9ca5fc 100644 --- a/src/commands/info/snowflake.ts +++ b/src/commands/info/snowflake.ts @@ -44,8 +44,14 @@ export default class SnowflakeCommand extends BushCommand { const channel = client.channels.resolve(snowflake)!; const channelInfo = [`**Type:** ${BushChannelType[channel.type]}`]; if (channel.isDM()) { - channelInfo.push(`**Recipient:** ${util.discord.escapeMarkdown(channel.recipient.tag)} (${channel.recipient.id})`); - snowflakeEmbed.setTitle(`:snowflake: DM with ${util.discord.escapeMarkdown(channel.recipient.tag)} \`[Channel]\``); + channelInfo.push( + `**Recipient:** ${util.discord.escapeMarkdown(channel.recipient?.tag ?? '¯\\_(ツ)_/¯')} (${ + channel.recipient?.id ?? '¯\\_(ツ)_/¯' + })` + ); + snowflakeEmbed.setTitle( + `:snowflake: DM with ${util.discord.escapeMarkdown(channel.recipient?.tag ?? '¯\\_(ツ)_/¯')} \`[Channel]\`` + ); } else if ( channel.isCategory() || channel.isNews() || diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index a09d8ca..4f11936 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -207,7 +207,12 @@ export default class UserInfoCommand extends BushCommand { .filter((role) => role.name !== '@everyone') .sort((role1, role2) => role2.position - role1.position) .map((role) => `${role}`); - embed.addFields({ name: `» Role${roles.length - 1 ? 's' : ''} [${roles.length}]`, value: roles.join(', ') }); + + const joined = roles.join(', '); + embed.addFields({ + name: `» Role${roles.length - 1 ? 's' : ''} [${roles.length}]`, + value: joined.length > 1024 ? 'Too Many Roles to Display' + '...' : joined + }); } private static generatePermissionsField(embed: Embed, member: BushGuildMember | undefined) { |