types(interactions): fix {Slash,ContextMenu}CommandBuilder#toJSON (#8568)

This commit is contained in:
A. Román
2022-09-02 17:31:25 +02:00
committed by GitHub
parent f77612a55e
commit b7eb96d456
2 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import type {
LocaleString,
LocalizationMap,
Permissions,
RESTPostAPIApplicationCommandsJSONBody,
RESTPostAPIContextMenuApplicationCommandsJSONBody,
} from 'discord-api-types/v10';
import { validateLocale, validateLocalizationMap } from '../slashCommands/Assertions.js';
import {
@@ -176,7 +176,7 @@ export class ContextMenuCommandBuilder {
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
public toJSON(): RESTPostAPIApplicationCommandsJSONBody {
public toJSON(): RESTPostAPIContextMenuApplicationCommandsJSONBody {
validateRequiredParameters(this.name, this.type);
validateLocalizationMap(this.name_localizations);

View File

@@ -2,7 +2,7 @@ import type {
APIApplicationCommandOption,
LocalizationMap,
Permissions,
RESTPostAPIApplicationCommandsJSONBody,
RESTPostAPIChatInputApplicationCommandsJSONBody,
} from 'discord-api-types/v10';
import { mix } from 'ts-mixer';
import {
@@ -69,7 +69,7 @@ export class SlashCommandBuilder {
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
public toJSON(): RESTPostAPIApplicationCommandsJSONBody {
public toJSON(): RESTPostAPIChatInputApplicationCommandsJSONBody {
validateRequiredParameters(this.name, this.description, this.options);
validateLocalizationMap(this.name_localizations);