/** @module ClientApplication */ import Base from "./Base"; import type ApplicationCommand from "./ApplicationCommand"; import type Client from "../Client"; import type { RawClientApplication, RoleConnection, RoleConnectionMetadata } from "../types/oauth"; import type { AnyApplicationCommand, ApplicationCommandOptionConversion, CreateApplicationCommandOptions, CreateGuildApplicationCommandOptions, EditApplicationCommandOptions, EditApplicationCommandPermissionsOptions, EditGuildApplicationCommandOptions, GetApplicationCommandOptions, RESTGuildApplicationCommandPermissions } from "../types/application-commands"; import type { JSONClientApplication } from "../types/json"; import type { ApplicationCommandTypes } from "../Constants"; /** A representation of the authorized client's application (typically received via gateway). */ export default class ClientApplication extends Base { /** This application's [public flags](https://discord.com/developers/docs/resources/application#application-object-application-flags). */ flags: number; constructor(data: RawClientApplication, client: Client); protected update(data: Partial): void; /** * Overwrite all existing global application commands. * @param options The commands. */ bulkEditGlobalCommands(options: Array): Promise>>; /** * Overwrite all existing application commands in a guild. * @param guildID The ID of the guild. * @param options The commands. */ bulkEditGuildCommands(guildID: string, options: Array): Promise>>; /** * Create a global application command. * @param options The options for creating the command. */ createGlobalCommand(options: T): Promise>; /** * Create a guild application command. * @param guildID The ID of the guild. * @param options The options for creating the command. */ createGuildCommand(guildID: string, options: T): Promise>; /** * Delete a global application command. * @param commandID The ID of the command. */ deleteGlobalCommand(commandID: string): Promise; /** * Delete a guild application command. * @param guildID The ID of the guild. * @param commandID The ID of the command. */ deleteGuildCommand(guildID: string, commandID: string): Promise; /** * Edit a global application command. * @param commandID The ID of the command. * @param options The options for editing the command. */ editGlobalCommand(commandID: string, options: T): Promise>; /** * Edit a guild application command. * @param guildID The ID of the guild. * @param commandID The ID of the command. * @param options The options for editing the command. */ editGuildCommand(guildID: string, commandID: string, options: T): Promise>; /** * Edit a guild application command's permissions. This requires a bearer token with the `applications.commands.permissions.update` scope. * @param guildID The ID of the guild. * @param commandID The ID of the command. * @param options The options for editing the permissions. */ editGuildCommandPermissions(guildID: string, commandID: string, options: EditApplicationCommandPermissionsOptions): Promise; /** * Get a global application command. * @param commandID The ID of the command. * @param options The options for getting the command. */ getGlobalCommand(commandID: string, options?: GetApplicationCommandOptions): Promise; /** * Get this application's global commands. * @param options The options for getting the command. */ getGlobalCommands(options?: GetApplicationCommandOptions): Promise>; /** * Get a global application command. * @param guildID The ID of the guild. * @param commandID The ID of the command. * @param options The options for getting the command. */ getGuildCommand(guildID: string, commandID: string, options?: GetApplicationCommandOptions): Promise; /** * Get this application's commands in a specific guild. * @param guildID The ID of the guild. * @param options The options for getting the command. */ getGuildCommands(guildID: string, options?: GetApplicationCommandOptions): Promise>; /** * Get a command's permissions in a guild. * @param guildID The ID of the guild. * @param commandID The ID of the command. */ getGuildPermission(guildID: string, commandID: string): Promise; /** * Get the permissions for all commands in a guild. * @param guildID The ID of the guild. */ getGuildPermissions(guildID: string): Promise>; /** * Get this application's role connection metadata records. */ getRoleConnectionsMetadata(): Promise>; /** * Get the authenticated user's role connection object for this application. This requires the `role_connections.write` scope. */ getUserRoleConnection(): Promise; toJSON(): JSONClientApplication; /** * Update this application's role connections metadata. * @param metadata The metadata records. */ updateRoleConnectionsMetata(metadata: Array): Promise>; /** * Update the authenticated user's role connection object for an application. This requires the `role_connections.write` scope. * @param data The metadata to update. */ updateUserRoleConnection(data: RoleConnection): Promise; }