diff --git a/src/channels/discord.test.ts b/src/channels/discord.test.ts index d974b2e..5db7420 100644 --- a/src/channels/discord.test.ts +++ b/src/channels/discord.test.ts @@ -98,6 +98,7 @@ vi.mock('discord.js', () => { Client: MockClient, Events, GatewayIntentBits, + MessageFlags: { SuppressEmbeds: 1 << 2 }, TextChannel, }; }); @@ -760,10 +761,12 @@ describe('DiscordChannel', () => { expect(mockChannel.send).toHaveBeenNthCalledWith(1, { content: 'x'.repeat(2000), files: undefined, + flags: 1 << 2, }); expect(mockChannel.send).toHaveBeenNthCalledWith(2, { content: 'x'.repeat(1000), files: undefined, + flags: 1 << 2, }); }); }); diff --git a/src/channels/discord.ts b/src/channels/discord.ts index 787ed71..bd24b8b 100644 --- a/src/channels/discord.ts +++ b/src/channels/discord.ts @@ -7,6 +7,7 @@ import { Events, GatewayIntentBits, Message, + MessageFlags, TextChannel, } from 'discord.js'; @@ -457,6 +458,7 @@ export class DiscordChannel implements Channel { await textChannel.send({ content: cleaned || undefined, files: files.length > 0 ? files : undefined, + flags: MessageFlags.SuppressEmbeds, }); } else { // Send text in chunks, attach images to the first chunk @@ -465,6 +467,7 @@ export class DiscordChannel implements Channel { await textChannel.send({ content: chunk, files: i === 0 && files.length > 0 ? files : undefined, + flags: MessageFlags.SuppressEmbeds, }); } }