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