diff --git a/lib/routes/Interactions.ts b/lib/routes/Interactions.ts index 746d3a45..47ffda63 100644 --- a/lib/routes/Interactions.ts +++ b/lib/routes/Interactions.ts @@ -47,7 +47,16 @@ export default class Interactions { content: options.data.content, components: options.data.components ? this._manager.client.util.componentsToRaw(options.data.components) : undefined, embeds: options.data.embeds ? this._manager.client.util.embedsToRaw(options.data.embeds) : undefined, - flags: options.data.flags + flags: options.data.flags, + poll: options.data.poll ? { + allow_multiselect: options.data.poll.allowMultiselect, + answers: options.data.poll.answers.map(a => ({ + poll_media: a.pollMedia + })), + duration: options.data.poll.duration, + layout_type: options.data.poll.layoutType, + question: options.data.poll.question + } : undefined }; break; } diff --git a/lib/routes/Webhooks.ts b/lib/routes/Webhooks.ts index 9d44a877..67b40b51 100644 --- a/lib/routes/Webhooks.ts +++ b/lib/routes/Webhooks.ts @@ -205,10 +205,18 @@ export default class Webhooks { content: options.content, embeds: options.embeds ? this._manager.client.util.embedsToRaw(options.embeds) : undefined, flags: options.flags, - poll: options.poll, - thread_name: options.threadName, - tts: options.tts, - username: options.username + poll: options.poll ? { + allow_multiselect: options.poll.allowMultiselect, + answers: options.poll.answers.map(a => ({ + poll_media: a.pollMedia + })), + duration: options.poll.duration, + layout_type: options.poll.layoutType, + question: options.poll.question + } : undefined, + thread_name: options.threadName, + tts: options.tts, + username: options.username }, files }).then(res => res === null ? undefined : new Message(res, this._manager.client));