diff --git a/src/discord/commands.ts b/src/discord/commands.ts index d780741..609d9c4 100644 --- a/src/discord/commands.ts +++ b/src/discord/commands.ts @@ -62,7 +62,7 @@ export class DiscordCommands { author: interaction.user.username, }); - return interaction.reply({ content: message }); + return interaction.reply({ content: message, flags: [MessageFlags.SuppressEmbeds] }); } @Slash({ name: 'link-remove', description: 'Remove an existing link' }) @@ -89,7 +89,7 @@ export class DiscordCommands { const { message, isPrivate } = await this.service.removeLink({ name }); - return interaction.reply({ content: message, ephemeral: isPrivate }); + return interaction.reply({ content: message, ephemeral: isPrivate, flags: [MessageFlags.SuppressEmbeds] }); } @Slash({ name: 'age', description: 'Immich age' }) diff --git a/src/services/discord.service.ts b/src/services/discord.service.ts index 669a0b0..705982b 100644 --- a/src/services/discord.service.ts +++ b/src/services/discord.service.ts @@ -102,10 +102,13 @@ export class DiscordService { ); } - return links.map(({ name, link }) => ({ - name: `${name} - ${link}`, - value: name, - })); + return links.map(({ name, link }) => { + const formattedName = `${name} — ${link}`; + return { + name: formattedName.length < 100 ? formattedName : `${formattedName.slice(0, 97)}...`, + value: name, + }; + }); } async addLink({ name, link, author }: { name: string; link: string; author: string }) {