fix(api): send stickers through webhooks (#2338)

This commit is contained in:
Hampus
2026-09-02 13:55:54 +02:00
committed by GitHub
parent 20cdfd3009
commit 5119febb5b
2 changed files with 4 additions and 3 deletions
@@ -1176,6 +1176,7 @@ export class MessageSendService {
embeds: data.embeds,
attachments: this.attachmentsToProcess(data.attachments),
attachmentUploadUserId: this.resolveWebhookAttachmentUploadUserId(webhook, data.attachments),
stickerIds: data.sticker_ids ? data.sticker_ids.flatMap((stickerId) => createStickerID(stickerId)) : undefined,
messageReference,
messageSnapshots,
guildId: channel.guildId,
@@ -7,7 +7,7 @@ import {type ApiTestHarness, createApiTestHarness} from '../../test/ApiTestHarne
import {createBuilderWithoutAuth} from '../../test/TestRequestBuilder';
import {createWebhook, deleteWebhook} from './WebhookTestUtils';
describe('Webhook sticker bypass', () => {
describe('Webhook stickers', () => {
let harness: ApiTestHarness;
beforeAll(async () => {
harness = await createApiTestHarness();
@@ -15,7 +15,7 @@ describe('Webhook sticker bypass', () => {
beforeEach(async () => {
await harness.reset();
});
it('webhook messages ignore sticker_ids', async () => {
it('rejects unknown sticker_ids', async () => {
const user = await createTestAccount(harness);
const guild = await createGuild(harness, user.token, 'Webhook Sticker Test Guild');
const channelId = guild.system_channel_id!;
@@ -26,7 +26,7 @@ describe('Webhook sticker bypass', () => {
content: 'Webhook sticker test',
sticker_ids: ['999999999999999999'],
})
.expect(204)
.expect(400)
.execute();
await deleteWebhook(harness, webhook.id, user.token);
});