mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
refactor(InteractionResponses): use ClientOptions.jsonTransformer (#7599)
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
const { isJSONEncodable } = require('@discordjs/builders');
|
const { isJSONEncodable } = require('@discordjs/builders');
|
||||||
const { InteractionResponseType, MessageFlags, Routes } = require('discord-api-types/v9');
|
const { InteractionResponseType, MessageFlags, Routes } = require('discord-api-types/v9');
|
||||||
const { Error } = require('../../errors');
|
const { Error } = require('../../errors');
|
||||||
const Transformers = require('../../util/Transformers');
|
|
||||||
const MessagePayload = require('../MessagePayload');
|
const MessagePayload = require('../MessagePayload');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -243,7 +242,7 @@ class InteractionResponses {
|
|||||||
await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
|
await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
|
||||||
body: {
|
body: {
|
||||||
type: InteractionResponseType.Modal,
|
type: InteractionResponseType.Modal,
|
||||||
data: isJSONEncodable(modal) ? modal.toJSON() : Transformers.toSnakeCase(modal),
|
data: isJSONEncodable(modal) ? modal.toJSON() : this.client.options.jsonTransformer(modal),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.replied = true;
|
this.replied = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user