refactor(InteractionResponses): use ClientOptions.jsonTransformer (#7599)

This commit is contained in:
muchnameless
2022-03-06 16:25:50 +01:00
committed by GitHub
parent 4b08d9b376
commit fac55bcfd1

View File

@@ -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;