diff options
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/dev/test.ts | 8 | ||||
| -rw-r--r-- | src/commands/info/snowflake.ts | 10 | ||||
| -rw-r--r-- | src/commands/info/userInfo.ts | 7 |
3 files changed, 18 insertions, 7 deletions
diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts index cca40a6..3f9cd80 100644 --- a/src/commands/dev/test.ts +++ b/src/commands/dev/test.ts @@ -2,13 +2,13 @@ import { BushCommand, ButtonPaginator, Shared, type BushMessage } from '#lib'; import { Routes } from 'discord-api-types/rest/v9'; import { ActionRow, - ActionRowComponent, ButtonComponent, ButtonStyle, Embed, GatewayDispatchEvents, type ApplicationCommand, - type Collection + type Collection, + type MessageActionRowComponent } from 'discord.js'; import badLinksSecretArray from '../../lib/badlinks-secret.js'; import badLinksArray from '../../lib/badlinks.js'; @@ -81,7 +81,7 @@ export default class TestCommand extends BushCommand { ); return await message.util.reply({ content: 'Test', embeds: [embed], components: [buttonRow] }); } else if (['lots of buttons'].includes(args?.feature?.toLowerCase())) { - const ButtonRows: ActionRow<ActionRowComponent>[] = []; + const ButtonRows: ActionRow<MessageActionRowComponent>[] = []; for (let a = 1; a <= 5; a++) { const row = new ActionRow(); for (let b = 1; b <= 5; b++) { @@ -113,7 +113,7 @@ export default class TestCommand extends BushCommand { const embeds = colors.map((c, i) => ({ ...o, title: `Embed Title ${i}`, color: c })); - const ButtonRows: ActionRow<ActionRowComponent>[] = []; + const ButtonRows: ActionRow<MessageActionRowComponent>[] = []; for (let a = 1; a <= 5; a++) { const row = new ActionRow(); for (let b = 1; b <= 5; b++) { 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) { |
