mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
fix(api): send stickers through webhooks (#2338)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user