oceanic.js 1.10.1-dev.97cef9c → 1.10.1-dev.9b37972
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +5 -5
- package/esm.mjs +2 -0
- package/package.json +5 -5
- package/dist/lib/Client.d.ts +0 -91
- package/dist/lib/Client.js +0 -254
- package/dist/lib/Constants.d.ts +0 -1121
- package/dist/lib/Constants.js +0 -1401
- package/dist/lib/gateway/Shard.d.ts +0 -77
- package/dist/lib/gateway/Shard.js +0 -1582
- package/dist/lib/gateway/ShardManager.d.ts +0 -26
- package/dist/lib/gateway/ShardManager.js +0 -304
- package/dist/lib/index.d.ts +0 -83
- package/dist/lib/index.js +0 -166
- package/dist/lib/rest/Bucket.d.ts +0 -33
- package/dist/lib/rest/Bucket.js +0 -78
- package/dist/lib/rest/DiscordHTTPError.d.ts +0 -16
- package/dist/lib/rest/DiscordHTTPError.js +0 -65
- package/dist/lib/rest/DiscordRESTError.d.ts +0 -19
- package/dist/lib/rest/DiscordRESTError.js +0 -89
- package/dist/lib/rest/OAuthHelper.d.ts +0 -60
- package/dist/lib/rest/OAuthHelper.js +0 -180
- package/dist/lib/rest/RESTManager.d.ts +0 -42
- package/dist/lib/rest/RESTManager.js +0 -82
- package/dist/lib/rest/RequestHandler.d.ts +0 -28
- package/dist/lib/rest/RequestHandler.js +0 -313
- package/dist/lib/rest/SequentialBucket.d.ts +0 -25
- package/dist/lib/rest/SequentialBucket.js +0 -76
- package/dist/lib/routes/Applications.d.ts +0 -171
- package/dist/lib/routes/Applications.js +0 -447
- package/dist/lib/routes/Channels.d.ts +0 -391
- package/dist/lib/routes/Channels.js +0 -1107
- package/dist/lib/routes/Guilds.d.ts +0 -606
- package/dist/lib/routes/Guilds.js +0 -1669
- package/dist/lib/routes/Interactions.d.ts +0 -74
- package/dist/lib/routes/Interactions.js +0 -141
- package/dist/lib/routes/Miscellaneous.d.ts +0 -25
- package/dist/lib/routes/Miscellaneous.js +0 -54
- package/dist/lib/routes/OAuth.d.ts +0 -105
- package/dist/lib/routes/OAuth.js +0 -309
- package/dist/lib/routes/Users.d.ts +0 -32
- package/dist/lib/routes/Users.js +0 -59
- package/dist/lib/routes/Webhooks.d.ts +0 -128
- package/dist/lib/routes/Webhooks.js +0 -264
- package/dist/lib/structures/AnnouncementChannel.d.ts +0 -36
- package/dist/lib/structures/AnnouncementChannel.js +0 -47
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +0 -18
- package/dist/lib/structures/AnnouncementThreadChannel.js +0 -27
- package/dist/lib/structures/Application.d.ts +0 -68
- package/dist/lib/structures/Application.js +0 -178
- package/dist/lib/structures/ApplicationCommand.d.ts +0 -74
- package/dist/lib/structures/ApplicationCommand.js +0 -141
- package/dist/lib/structures/Attachment.d.ts +0 -34
- package/dist/lib/structures/Attachment.js +0 -64
- package/dist/lib/structures/AuditLogEntry.d.ts +0 -25
- package/dist/lib/structures/AuditLogEntry.js +0 -53
- package/dist/lib/structures/AutoModerationRule.d.ts +0 -49
- package/dist/lib/structures/AutoModerationRule.js +0 -139
- package/dist/lib/structures/AutocompleteInteraction.d.ts +0 -62
- package/dist/lib/structures/AutocompleteInteraction.js +0 -115
- package/dist/lib/structures/Base.d.ts +0 -20
- package/dist/lib/structures/Base.js +0 -58
- package/dist/lib/structures/BaseEntitlement.d.ts +0 -19
- package/dist/lib/structures/BaseEntitlement.js +0 -44
- package/dist/lib/structures/CategoryChannel.d.ts +0 -41
- package/dist/lib/structures/CategoryChannel.js +0 -105
- package/dist/lib/structures/Channel.d.ts +0 -20
- package/dist/lib/structures/Channel.js +0 -91
- package/dist/lib/structures/ClientApplication.d.ts +0 -153
- package/dist/lib/structures/ClientApplication.js +0 -220
- package/dist/lib/structures/CommandInteraction.d.ts +0 -127
- package/dist/lib/structures/CommandInteraction.js +0 -297
- package/dist/lib/structures/ComponentInteraction.d.ts +0 -137
- package/dist/lib/structures/ComponentInteraction.js +0 -311
- package/dist/lib/structures/Entitlement.d.ts +0 -12
- package/dist/lib/structures/Entitlement.js +0 -26
- package/dist/lib/structures/ExtendedUser.d.ts +0 -26
- package/dist/lib/structures/ExtendedUser.js +0 -57
- package/dist/lib/structures/ForumChannel.d.ts +0 -11
- package/dist/lib/structures/ForumChannel.js +0 -19
- package/dist/lib/structures/GroupChannel.d.ts +0 -62
- package/dist/lib/structures/GroupChannel.js +0 -133
- package/dist/lib/structures/Guild.d.ts +0 -654
- package/dist/lib/structures/Guild.js +0 -1319
- package/dist/lib/structures/GuildChannel.d.ts +0 -34
- package/dist/lib/structures/GuildChannel.js +0 -75
- package/dist/lib/structures/GuildPreview.d.ts +0 -50
- package/dist/lib/structures/GuildPreview.js +0 -119
- package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -60
- package/dist/lib/structures/GuildScheduledEvent.js +0 -154
- package/dist/lib/structures/GuildTemplate.d.ts +0 -55
- package/dist/lib/structures/GuildTemplate.js +0 -126
- package/dist/lib/structures/Integration.d.ts +0 -54
- package/dist/lib/structures/Integration.js +0 -156
- package/dist/lib/structures/Interaction.d.ts +0 -40
- package/dist/lib/structures/Interaction.js +0 -91
- package/dist/lib/structures/InteractionResolvedChannel.d.ts +0 -28
- package/dist/lib/structures/InteractionResolvedChannel.js +0 -45
- package/dist/lib/structures/Invite.d.ts +0 -64
- package/dist/lib/structures/Invite.js +0 -193
- package/dist/lib/structures/InviteGuild.d.ts +0 -52
- package/dist/lib/structures/InviteGuild.js +0 -88
- package/dist/lib/structures/MediaChannel.d.ts +0 -11
- package/dist/lib/structures/MediaChannel.js +0 -19
- package/dist/lib/structures/Member.d.ts +0 -122
- package/dist/lib/structures/Member.js +0 -255
- package/dist/lib/structures/Message.d.ts +0 -183
- package/dist/lib/structures/Message.js +0 -455
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +0 -128
- package/dist/lib/structures/ModalSubmitInteraction.js +0 -240
- package/dist/lib/structures/OAuthApplication.d.ts +0 -79
- package/dist/lib/structures/OAuthApplication.js +0 -210
- package/dist/lib/structures/OAuthGuild.d.ts +0 -35
- package/dist/lib/structures/OAuthGuild.js +0 -61
- package/dist/lib/structures/PartialApplication.d.ts +0 -30
- package/dist/lib/structures/PartialApplication.js +0 -67
- package/dist/lib/structures/Permission.d.ts +0 -21
- package/dist/lib/structures/Permission.js +0 -68
- package/dist/lib/structures/PermissionOverwrite.d.ts +0 -26
- package/dist/lib/structures/PermissionOverwrite.js +0 -49
- package/dist/lib/structures/PingInteraction.d.ts +0 -16
- package/dist/lib/structures/PingInteraction.js +0 -26
- package/dist/lib/structures/PrivateChannel.d.ts +0 -90
- package/dist/lib/structures/PrivateChannel.js +0 -131
- package/dist/lib/structures/PrivateThreadChannel.d.ts +0 -18
- package/dist/lib/structures/PrivateThreadChannel.js +0 -27
- package/dist/lib/structures/PublicThreadChannel.d.ts +0 -21
- package/dist/lib/structures/PublicThreadChannel.js +0 -37
- package/dist/lib/structures/Role.d.ts +0 -50
- package/dist/lib/structures/Role.js +0 -131
- package/dist/lib/structures/SKU.d.ts +0 -32
- package/dist/lib/structures/SKU.js +0 -53
- package/dist/lib/structures/StageChannel.d.ts +0 -33
- package/dist/lib/structures/StageChannel.js +0 -44
- package/dist/lib/structures/StageInstance.d.ts +0 -36
- package/dist/lib/structures/StageInstance.js +0 -94
- package/dist/lib/structures/Team.d.ts +0 -22
- package/dist/lib/structures/Team.js +0 -67
- package/dist/lib/structures/TestEntitlement.d.ts +0 -10
- package/dist/lib/structures/TestEntitlement.js +0 -21
- package/dist/lib/structures/TextChannel.d.ts +0 -34
- package/dist/lib/structures/TextChannel.js +0 -46
- package/dist/lib/structures/TextableChannel.d.ts +0 -158
- package/dist/lib/structures/TextableChannel.js +0 -276
- package/dist/lib/structures/TextableVoiceChannel.d.ts +0 -39
- package/dist/lib/structures/TextableVoiceChannel.js +0 -81
- package/dist/lib/structures/ThreadChannel.d.ts +0 -159
- package/dist/lib/structures/ThreadChannel.js +0 -295
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +0 -99
- package/dist/lib/structures/ThreadOnlyChannel.js +0 -233
- package/dist/lib/structures/ThreadableChannel.d.ts +0 -36
- package/dist/lib/structures/ThreadableChannel.js +0 -58
- package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
- package/dist/lib/structures/UnavailableGuild.js +0 -21
- package/dist/lib/structures/User.d.ts +0 -82
- package/dist/lib/structures/User.js +0 -168
- package/dist/lib/structures/VoiceChannel.d.ts +0 -20
- package/dist/lib/structures/VoiceChannel.js +0 -35
- package/dist/lib/structures/VoiceState.d.ts +0 -51
- package/dist/lib/structures/VoiceState.js +0 -140
- package/dist/lib/structures/Webhook.d.ts +0 -129
- package/dist/lib/structures/Webhook.js +0 -206
- package/dist/lib/types/applications.d.ts +0 -448
- package/dist/lib/types/audit-log.d.ts +0 -121
- package/dist/lib/types/auto-moderation.d.ts +0 -99
- package/dist/lib/types/channels.d.ts +0 -1150
- package/dist/lib/types/client.d.ts +0 -228
- package/dist/lib/types/events.d.ts +0 -260
- package/dist/lib/types/gateway-raw.d.ts +0 -567
- package/dist/lib/types/gateway.d.ts +0 -338
- package/dist/lib/types/guild-template.d.ts +0 -33
- package/dist/lib/types/guilds.d.ts +0 -854
- package/dist/lib/types/index.d.ts +0 -18
- package/dist/lib/types/interactions.d.ts +0 -376
- package/dist/lib/types/json.d.ts +0 -709
- package/dist/lib/types/misc.d.ts +0 -13
- package/dist/lib/types/oauth.d.ts +0 -201
- package/dist/lib/types/request-handler.d.ts +0 -52
- package/dist/lib/types/scheduled-events.d.ts +0 -88
- package/dist/lib/types/shared.d.ts +0 -9
- package/dist/lib/types/users.d.ts +0 -45
- package/dist/lib/types/voice.d.ts +0 -45
- package/dist/lib/types/webhooks.d.ts +0 -73
- package/dist/lib/util/Collection.d.ts +0 -47
- package/dist/lib/util/Collection.js +0 -78
- package/dist/lib/util/Errors.d.ts +0 -29
- package/dist/lib/util/Errors.js +0 -56
- package/dist/lib/util/Routes.d.ts +0 -124
- package/dist/lib/util/Routes.js +0 -243
- package/dist/lib/util/SimpleCollection.d.ts +0 -12
- package/dist/lib/util/SimpleCollection.js +0 -81
- package/dist/lib/util/TypedCollection.d.ts +0 -24
- package/dist/lib/util/TypedCollection.js +0 -76
- package/dist/lib/util/TypedEmitter.d.ts +0 -19
- package/dist/lib/util/TypedEmitter.js +0 -19
- package/dist/lib/util/Util.d.ts +0 -52
- package/dist/lib/util/Util.js +0 -469
- package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +0 -170
- package/dist/lib/util/interactions/InteractionOptionsWrapper.js +0 -213
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +0 -24
- package/dist/lib/util/interactions/MessageInteractionResponse.js +0 -28
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +0 -24
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +0 -34
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +0 -60
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +0 -124
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @module Channel */
|
|
2
|
-
import Base from "./Base";
|
|
3
|
-
import { ChannelTypes } from "../Constants";
|
|
4
|
-
import type Client from "../Client";
|
|
5
|
-
import type { AnyChannel, RawChannel } from "../types/channels";
|
|
6
|
-
import type { JSONChannel } from "../types/json";
|
|
7
|
-
/** Represents a channel. */
|
|
8
|
-
export default class Channel extends Base {
|
|
9
|
-
/** The [type](https://discord.com/developers/docs/resources/channel#channel-object-channel-types) of this channel. */
|
|
10
|
-
type: ChannelTypes;
|
|
11
|
-
constructor(data: RawChannel, client: Client);
|
|
12
|
-
static from<T extends AnyChannel = AnyChannel>(data: RawChannel, client: Client): T;
|
|
13
|
-
/** A string that will mention this channel. */
|
|
14
|
-
get mention(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Close a direct message, leave a group channel, or delete a guild channel.
|
|
17
|
-
*/
|
|
18
|
-
delete(): Promise<void>;
|
|
19
|
-
toJSON(): JSONChannel;
|
|
20
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/** @module Channel */
|
|
5
|
-
const Base_1 = tslib_1.__importDefault(require("./Base"));
|
|
6
|
-
const Constants_1 = require("../Constants");
|
|
7
|
-
/** Represents a channel. */
|
|
8
|
-
class Channel extends Base_1.default {
|
|
9
|
-
/** The [type](https://discord.com/developers/docs/resources/channel#channel-object-channel-types) of this channel. */
|
|
10
|
-
type;
|
|
11
|
-
constructor(data, client) {
|
|
12
|
-
super(data.id, client);
|
|
13
|
-
this.type = data.type;
|
|
14
|
-
}
|
|
15
|
-
static from(data, client) {
|
|
16
|
-
switch (data.type) {
|
|
17
|
-
case Constants_1.ChannelTypes.GUILD_TEXT: {
|
|
18
|
-
return new TextChannel(data, client);
|
|
19
|
-
}
|
|
20
|
-
case Constants_1.ChannelTypes.DM: {
|
|
21
|
-
return new PrivateChannel(data, client);
|
|
22
|
-
}
|
|
23
|
-
case Constants_1.ChannelTypes.GUILD_VOICE: {
|
|
24
|
-
return new VoiceChannel(data, client);
|
|
25
|
-
}
|
|
26
|
-
case Constants_1.ChannelTypes.GROUP_DM: {
|
|
27
|
-
return new GroupChannel(data, client);
|
|
28
|
-
}
|
|
29
|
-
case Constants_1.ChannelTypes.GUILD_CATEGORY: {
|
|
30
|
-
return new CategoryChannel(data, client);
|
|
31
|
-
}
|
|
32
|
-
case Constants_1.ChannelTypes.GUILD_ANNOUNCEMENT: {
|
|
33
|
-
return new AnnouncementChannel(data, client);
|
|
34
|
-
}
|
|
35
|
-
case Constants_1.ChannelTypes.ANNOUNCEMENT_THREAD: {
|
|
36
|
-
return new AnnouncementThreadChannel(data, client);
|
|
37
|
-
}
|
|
38
|
-
case Constants_1.ChannelTypes.PUBLIC_THREAD: {
|
|
39
|
-
return new PublicThreadChannel(data, client);
|
|
40
|
-
}
|
|
41
|
-
case Constants_1.ChannelTypes.PRIVATE_THREAD: {
|
|
42
|
-
return new PrivateThreadChannel(data, client);
|
|
43
|
-
}
|
|
44
|
-
case Constants_1.ChannelTypes.GUILD_STAGE_VOICE: {
|
|
45
|
-
return new StageChannel(data, client);
|
|
46
|
-
}
|
|
47
|
-
case Constants_1.ChannelTypes.GUILD_FORUM: {
|
|
48
|
-
return new ForumChannel(data, client);
|
|
49
|
-
}
|
|
50
|
-
case Constants_1.ChannelTypes.GUILD_MEDIA: {
|
|
51
|
-
return new MediaChannel(data, client);
|
|
52
|
-
}
|
|
53
|
-
default: {
|
|
54
|
-
return new Channel(data, client);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/** A string that will mention this channel. */
|
|
59
|
-
get mention() {
|
|
60
|
-
return `<#${this.id}>`;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Close a direct message, leave a group channel, or delete a guild channel.
|
|
64
|
-
*/
|
|
65
|
-
async delete() {
|
|
66
|
-
await this.client.rest.channels.delete(this.id);
|
|
67
|
-
}
|
|
68
|
-
toJSON() {
|
|
69
|
-
return {
|
|
70
|
-
...super.toJSON(),
|
|
71
|
-
type: this.type
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.default = Channel;
|
|
76
|
-
// Yes this sucks, but it works. That's the important part. Circular imports are hell.
|
|
77
|
-
/* eslint-disable @typescript-eslint/no-var-requires, unicorn/prefer-module */
|
|
78
|
-
const TextChannel = require("./TextChannel").default;
|
|
79
|
-
const PrivateChannel = require("./PrivateChannel").default;
|
|
80
|
-
const VoiceChannel = require("./VoiceChannel").default;
|
|
81
|
-
const CategoryChannel = require("./CategoryChannel").default;
|
|
82
|
-
const GroupChannel = require("./GroupChannel").default;
|
|
83
|
-
const AnnouncementChannel = require("./AnnouncementChannel").default;
|
|
84
|
-
const PublicThreadChannel = require("./PublicThreadChannel").default;
|
|
85
|
-
const PrivateThreadChannel = require("./PrivateThreadChannel").default;
|
|
86
|
-
const AnnouncementThreadChannel = require("./AnnouncementThreadChannel").default;
|
|
87
|
-
const StageChannel = require("./StageChannel").default;
|
|
88
|
-
const ForumChannel = require("./ForumChannel").default;
|
|
89
|
-
const MediaChannel = require("./MediaChannel").default;
|
|
90
|
-
/* eslint-enable @typescript-eslint/no-var-requires, unicorn/prefer-module */
|
|
91
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2hhbm5lbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL0NoYW5uZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0JBQXNCO0FBQ3RCLDBEQUEwQjtBQUMxQiw0Q0FBNEM7QUFvQjVDLDRCQUE0QjtBQUM1QixNQUFxQixPQUFRLFNBQVEsY0FBSTtJQUNyQyxzSEFBc0g7SUFDdEgsSUFBSSxDQUFlO0lBQ25CLFlBQVksSUFBZ0IsRUFBRSxNQUFjO1FBQ3hDLEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLE1BQU0sQ0FBQyxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQztJQUMxQixDQUFDO0lBRUQsTUFBTSxDQUFDLElBQUksQ0FBb0MsSUFBZ0IsRUFBRSxNQUFjO1FBQzNFLFFBQVEsSUFBSSxDQUFDLElBQUksRUFBRSxDQUFDO1lBQ2hCLEtBQUssd0JBQVksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUMzQixPQUFPLElBQUksV0FBVyxDQUFDLElBQXNCLEVBQUUsTUFBTSxDQUFNLENBQUM7WUFDaEUsQ0FBQztZQUNELEtBQUssd0JBQVksQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO2dCQUNuQixPQUFPLElBQUksY0F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type ApplicationCommand from "./ApplicationCommand";
|
|
4
|
-
import TestEntitlement from "./TestEntitlement";
|
|
5
|
-
import Entitlement from "./Entitlement";
|
|
6
|
-
import type SKU from "./SKU";
|
|
7
|
-
import type Application from "./Application";
|
|
8
|
-
import type Client from "../Client";
|
|
9
|
-
import type { RoleConnection, RoleConnectionMetadata, UpdateUserApplicationRoleConnectionOptions } from "../types/oauth";
|
|
10
|
-
import type { AnyApplicationCommand, ApplicationCommandOptionConversion, CreateApplicationCommandOptions, CreateGuildApplicationCommandOptions, EditApplicationCommandOptions, EditApplicationCommandPermissionsOptions, EditGuildApplicationCommandOptions, GetApplicationCommandOptions, RESTGuildApplicationCommandPermissions, CreateTestEntitlementOptions, RawEntitlement, RawTestEntitlement, SearchEntitlementsOptions, RawClientApplication, EditApplicationOptions } from "../types/applications";
|
|
11
|
-
import type { JSONClientApplication } from "../types/json";
|
|
12
|
-
import type { ApplicationCommandTypes } from "../Constants";
|
|
13
|
-
import TypedCollection from "../util/TypedCollection";
|
|
14
|
-
/** A representation of the authorized client's application (typically received via gateway). */
|
|
15
|
-
export default class ClientApplication extends Base {
|
|
16
|
-
/** The entitlements for this application. This will almost certainly be empty unless you fetch entitlements, or recieve new/updated entitlements. */
|
|
17
|
-
entitlements: TypedCollection<RawEntitlement | RawTestEntitlement, Entitlement | TestEntitlement>;
|
|
18
|
-
/** This application's [flags](https://discord.com/developers/docs/resources/application#application-object-application-flags). */
|
|
19
|
-
flags: number;
|
|
20
|
-
constructor(data: RawClientApplication, client: Client);
|
|
21
|
-
protected update(data: Partial<RawClientApplication>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Overwrite all existing global application commands.
|
|
24
|
-
* @param options The commands.
|
|
25
|
-
*/
|
|
26
|
-
bulkEditGlobalCommands(options: Array<CreateApplicationCommandOptions>): Promise<Array<ApplicationCommand<ApplicationCommandTypes>>>;
|
|
27
|
-
/**
|
|
28
|
-
* Overwrite all existing application commands in a guild.
|
|
29
|
-
* @param guildID The ID of the guild.
|
|
30
|
-
* @param options The commands.
|
|
31
|
-
*/
|
|
32
|
-
bulkEditGuildCommands(guildID: string, options: Array<CreateGuildApplicationCommandOptions>): Promise<Array<ApplicationCommand<ApplicationCommandTypes>>>;
|
|
33
|
-
/**
|
|
34
|
-
* Create a global application command.
|
|
35
|
-
* @param options The options for creating the command.
|
|
36
|
-
*/
|
|
37
|
-
createGlobalCommand<T extends CreateApplicationCommandOptions = CreateApplicationCommandOptions>(options: T): Promise<ApplicationCommandOptionConversion<T>>;
|
|
38
|
-
/**
|
|
39
|
-
* Create a guild application command.
|
|
40
|
-
* @param guildID The ID of the guild.
|
|
41
|
-
* @param options The options for creating the command.
|
|
42
|
-
*/
|
|
43
|
-
createGuildCommand<T extends CreateGuildApplicationCommandOptions = CreateGuildApplicationCommandOptions>(guildID: string, options: T): Promise<ApplicationCommandOptionConversion<T>>;
|
|
44
|
-
/**
|
|
45
|
-
* Create a test entitlement.
|
|
46
|
-
* @param options The options for creating the test entitlement.
|
|
47
|
-
*/
|
|
48
|
-
createTestEntitlement(options: CreateTestEntitlementOptions): Promise<TestEntitlement>;
|
|
49
|
-
/**
|
|
50
|
-
* Delete a global application command.
|
|
51
|
-
* @param commandID The ID of the command.
|
|
52
|
-
*/
|
|
53
|
-
deleteGlobalCommand(commandID: string): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Delete a guild application command.
|
|
56
|
-
* @param guildID The ID of the guild.
|
|
57
|
-
* @param commandID The ID of the command.
|
|
58
|
-
*/
|
|
59
|
-
deleteGuildCommand(guildID: string, commandID: string): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Delete a test entitlement.
|
|
62
|
-
* @param entitlementID The ID of the entitlement to delete.
|
|
63
|
-
*/
|
|
64
|
-
deleteTestEntitlement(entitlementID: string): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Edit this application.
|
|
67
|
-
* @param options The options for editing the application.
|
|
68
|
-
*/
|
|
69
|
-
edit(options: EditApplicationOptions): Promise<Application>;
|
|
70
|
-
/**
|
|
71
|
-
* Edit a global application command.
|
|
72
|
-
* @param commandID The ID of the command.
|
|
73
|
-
* @param options The options for editing the command.
|
|
74
|
-
*/
|
|
75
|
-
editGlobalCommand<T extends EditApplicationCommandOptions = EditApplicationCommandOptions>(commandID: string, options: T): Promise<ApplicationCommandOptionConversion<T>>;
|
|
76
|
-
/**
|
|
77
|
-
* Edit a guild application command.
|
|
78
|
-
* @param guildID The ID of the guild.
|
|
79
|
-
* @param commandID The ID of the command.
|
|
80
|
-
* @param options The options for editing the command.
|
|
81
|
-
*/
|
|
82
|
-
editGuildCommand<T extends EditGuildApplicationCommandOptions = EditGuildApplicationCommandOptions>(guildID: string, commandID: string, options: T): Promise<ApplicationCommandOptionConversion<T>>;
|
|
83
|
-
/**
|
|
84
|
-
* Edit a guild application command's permissions. This requires a bearer token with the `applications.commands.permissions.update` scope.
|
|
85
|
-
* @param guildID The ID of the guild.
|
|
86
|
-
* @param commandID The ID of the command.
|
|
87
|
-
* @param options The options for editing the permissions.
|
|
88
|
-
*/
|
|
89
|
-
editGuildCommandPermissions(guildID: string, commandID: string, options: EditApplicationCommandPermissionsOptions): Promise<RESTGuildApplicationCommandPermissions>;
|
|
90
|
-
/**
|
|
91
|
-
* Get the entitlements for this application.
|
|
92
|
-
* @param options The options for getting the entitlements.
|
|
93
|
-
*/
|
|
94
|
-
getEntitlements(options?: SearchEntitlementsOptions): Promise<Array<Entitlement | TestEntitlement>>;
|
|
95
|
-
/**
|
|
96
|
-
* Get a global application command.
|
|
97
|
-
* @param commandID The ID of the command.
|
|
98
|
-
* @param options The options for getting the command.
|
|
99
|
-
*/
|
|
100
|
-
getGlobalCommand<T extends AnyApplicationCommand = AnyApplicationCommand>(commandID: string, options?: GetApplicationCommandOptions): Promise<T>;
|
|
101
|
-
/**
|
|
102
|
-
* Get this application's global commands.
|
|
103
|
-
* @param options The options for getting the command.
|
|
104
|
-
*/
|
|
105
|
-
getGlobalCommands(options?: GetApplicationCommandOptions): Promise<Array<AnyApplicationCommand>>;
|
|
106
|
-
/**
|
|
107
|
-
* Get a global application command.
|
|
108
|
-
* @param guildID The ID of the guild.
|
|
109
|
-
* @param commandID The ID of the command.
|
|
110
|
-
* @param options The options for getting the command.
|
|
111
|
-
*/
|
|
112
|
-
getGuildCommand<T extends AnyApplicationCommand = AnyApplicationCommand>(guildID: string, commandID: string, options?: GetApplicationCommandOptions): Promise<T>;
|
|
113
|
-
/**
|
|
114
|
-
* Get this application's commands in a specific guild.
|
|
115
|
-
* @param guildID The ID of the guild.
|
|
116
|
-
* @param options The options for getting the command.
|
|
117
|
-
*/
|
|
118
|
-
getGuildCommands(guildID: string, options?: GetApplicationCommandOptions): Promise<Array<AnyApplicationCommand>>;
|
|
119
|
-
/**
|
|
120
|
-
* Get a command's permissions in a guild.
|
|
121
|
-
* @param guildID The ID of the guild.
|
|
122
|
-
* @param commandID The ID of the command.
|
|
123
|
-
*/
|
|
124
|
-
getGuildPermission(guildID: string, commandID: string): Promise<RESTGuildApplicationCommandPermissions>;
|
|
125
|
-
/**
|
|
126
|
-
* Get the permissions for all commands in a guild.
|
|
127
|
-
* @param guildID The ID of the guild.
|
|
128
|
-
*/
|
|
129
|
-
getGuildPermissions(guildID: string): Promise<Array<RESTGuildApplicationCommandPermissions>>;
|
|
130
|
-
/**
|
|
131
|
-
* Get this application's role connection metadata records.
|
|
132
|
-
*/
|
|
133
|
-
getRoleConnectionsMetadata(): Promise<Array<RoleConnectionMetadata>>;
|
|
134
|
-
/**
|
|
135
|
-
* Get the SKUs for this application.
|
|
136
|
-
*/
|
|
137
|
-
getSKUs(): Promise<Array<SKU>>;
|
|
138
|
-
/**
|
|
139
|
-
* Get the authenticated user's role connection object for this application. This requires the `role_connections.write` scope.
|
|
140
|
-
*/
|
|
141
|
-
getUserRoleConnection(): Promise<RoleConnection>;
|
|
142
|
-
toJSON(): JSONClientApplication;
|
|
143
|
-
/**
|
|
144
|
-
* Update this application's role connections metadata.
|
|
145
|
-
* @param metadata The metadata records.
|
|
146
|
-
*/
|
|
147
|
-
updateRoleConnectionsMetadata(metadata: Array<RoleConnectionMetadata>): Promise<Array<RoleConnectionMetadata>>;
|
|
148
|
-
/**
|
|
149
|
-
* Update the authenticated user's role connection object for an application. This requires the `role_connections.write` scope.
|
|
150
|
-
* @param data The metadata to update.
|
|
151
|
-
*/
|
|
152
|
-
updateUserRoleConnection(data: UpdateUserApplicationRoleConnectionOptions): Promise<RoleConnection>;
|
|
153
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/** @module ClientApplication */
|
|
5
|
-
const Base_1 = tslib_1.__importDefault(require("./Base"));
|
|
6
|
-
const TestEntitlement_1 = tslib_1.__importDefault(require("./TestEntitlement"));
|
|
7
|
-
const Entitlement_1 = tslib_1.__importDefault(require("./Entitlement"));
|
|
8
|
-
const BaseEntitlement_1 = tslib_1.__importDefault(require("./BaseEntitlement"));
|
|
9
|
-
const TypedCollection_1 = tslib_1.__importDefault(require("../util/TypedCollection"));
|
|
10
|
-
/** A representation of the authorized client's application (typically received via gateway). */
|
|
11
|
-
class ClientApplication extends Base_1.default {
|
|
12
|
-
/** The entitlements for this application. This will almost certainly be empty unless you fetch entitlements, or recieve new/updated entitlements. */
|
|
13
|
-
entitlements;
|
|
14
|
-
/** This application's [flags](https://discord.com/developers/docs/resources/application#application-object-application-flags). */
|
|
15
|
-
flags;
|
|
16
|
-
constructor(data, client) {
|
|
17
|
-
super(data.id, client);
|
|
18
|
-
this.entitlements = new TypedCollection_1.default(BaseEntitlement_1.default, client, Infinity, {
|
|
19
|
-
construct: (entitlement) => {
|
|
20
|
-
if ("subscription_id" in entitlement && entitlement.subscription_id) {
|
|
21
|
-
return new Entitlement_1.default(entitlement, client);
|
|
22
|
-
}
|
|
23
|
-
return new TestEntitlement_1.default(entitlement, client);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
this.flags = data.flags;
|
|
27
|
-
this.update(data);
|
|
28
|
-
}
|
|
29
|
-
update(data) {
|
|
30
|
-
if (data.flags !== undefined) {
|
|
31
|
-
this.flags = data.flags;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Overwrite all existing global application commands.
|
|
36
|
-
* @param options The commands.
|
|
37
|
-
*/
|
|
38
|
-
async bulkEditGlobalCommands(options) {
|
|
39
|
-
return this.client.rest.applications.bulkEditGlobalCommands(this.id, options);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Overwrite all existing application commands in a guild.
|
|
43
|
-
* @param guildID The ID of the guild.
|
|
44
|
-
* @param options The commands.
|
|
45
|
-
*/
|
|
46
|
-
async bulkEditGuildCommands(guildID, options) {
|
|
47
|
-
return this.client.rest.applications.bulkEditGuildCommands(this.id, guildID, options);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Create a global application command.
|
|
51
|
-
* @param options The options for creating the command.
|
|
52
|
-
*/
|
|
53
|
-
async createGlobalCommand(options) {
|
|
54
|
-
return this.client.rest.applications.createGlobalCommand(this.id, options);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Create a guild application command.
|
|
58
|
-
* @param guildID The ID of the guild.
|
|
59
|
-
* @param options The options for creating the command.
|
|
60
|
-
*/
|
|
61
|
-
async createGuildCommand(guildID, options) {
|
|
62
|
-
return this.client.rest.applications.createGuildCommand(this.id, guildID, options);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create a test entitlement.
|
|
66
|
-
* @param options The options for creating the test entitlement.
|
|
67
|
-
*/
|
|
68
|
-
async createTestEntitlement(options) {
|
|
69
|
-
return this.client.rest.applications.createTestEntitlement(this.id, options);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Delete a global application command.
|
|
73
|
-
* @param commandID The ID of the command.
|
|
74
|
-
*/
|
|
75
|
-
async deleteGlobalCommand(commandID) {
|
|
76
|
-
return this.client.rest.applications.deleteGlobalCommand(this.id, commandID);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Delete a guild application command.
|
|
80
|
-
* @param guildID The ID of the guild.
|
|
81
|
-
* @param commandID The ID of the command.
|
|
82
|
-
*/
|
|
83
|
-
async deleteGuildCommand(guildID, commandID) {
|
|
84
|
-
return this.client.rest.applications.deleteGuildCommand(this.id, guildID, commandID);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Delete a test entitlement.
|
|
88
|
-
* @param entitlementID The ID of the entitlement to delete.
|
|
89
|
-
*/
|
|
90
|
-
async deleteTestEntitlement(entitlementID) {
|
|
91
|
-
return this.client.rest.applications.deleteTestEntitlement(this.id, entitlementID);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Edit this application.
|
|
95
|
-
* @param options The options for editing the application.
|
|
96
|
-
*/
|
|
97
|
-
async edit(options) {
|
|
98
|
-
return this.client.rest.applications.editCurrent(options);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Edit a global application command.
|
|
102
|
-
* @param commandID The ID of the command.
|
|
103
|
-
* @param options The options for editing the command.
|
|
104
|
-
*/
|
|
105
|
-
async editGlobalCommand(commandID, options) {
|
|
106
|
-
return this.client.rest.applications.editGlobalCommand(this.id, commandID, options);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Edit a guild application command.
|
|
110
|
-
* @param guildID The ID of the guild.
|
|
111
|
-
* @param commandID The ID of the command.
|
|
112
|
-
* @param options The options for editing the command.
|
|
113
|
-
*/
|
|
114
|
-
async editGuildCommand(guildID, commandID, options) {
|
|
115
|
-
return this.client.rest.applications.editGuildCommand(this.id, guildID, commandID, options);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Edit a guild application command's permissions. This requires a bearer token with the `applications.commands.permissions.update` scope.
|
|
119
|
-
* @param guildID The ID of the guild.
|
|
120
|
-
* @param commandID The ID of the command.
|
|
121
|
-
* @param options The options for editing the permissions.
|
|
122
|
-
*/
|
|
123
|
-
async editGuildCommandPermissions(guildID, commandID, options) {
|
|
124
|
-
return this.client.rest.applications.editGuildCommandPermissions(this.id, guildID, commandID, options);
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Get the entitlements for this application.
|
|
128
|
-
* @param options The options for getting the entitlements.
|
|
129
|
-
*/
|
|
130
|
-
async getEntitlements(options = {}) {
|
|
131
|
-
return this.client.rest.applications.getEntitlements(this.id, options);
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Get a global application command.
|
|
135
|
-
* @param commandID The ID of the command.
|
|
136
|
-
* @param options The options for getting the command.
|
|
137
|
-
*/
|
|
138
|
-
async getGlobalCommand(commandID, options) {
|
|
139
|
-
return this.client.rest.applications.getGlobalCommand(this.id, commandID, options);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Get this application's global commands.
|
|
143
|
-
* @param options The options for getting the command.
|
|
144
|
-
*/
|
|
145
|
-
async getGlobalCommands(options) {
|
|
146
|
-
return this.client.rest.applications.getGlobalCommands(this.id, options);
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Get a global application command.
|
|
150
|
-
* @param guildID The ID of the guild.
|
|
151
|
-
* @param commandID The ID of the command.
|
|
152
|
-
* @param options The options for getting the command.
|
|
153
|
-
*/
|
|
154
|
-
async getGuildCommand(guildID, commandID, options) {
|
|
155
|
-
return this.client.rest.applications.getGuildCommand(this.id, guildID, commandID, options);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Get this application's commands in a specific guild.
|
|
159
|
-
* @param guildID The ID of the guild.
|
|
160
|
-
* @param options The options for getting the command.
|
|
161
|
-
*/
|
|
162
|
-
async getGuildCommands(guildID, options) {
|
|
163
|
-
return this.client.rest.applications.getGuildCommands(this.id, guildID, options);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Get a command's permissions in a guild.
|
|
167
|
-
* @param guildID The ID of the guild.
|
|
168
|
-
* @param commandID The ID of the command.
|
|
169
|
-
*/
|
|
170
|
-
async getGuildPermission(guildID, commandID) {
|
|
171
|
-
return this.client.rest.applications.getGuildPermission(this.id, guildID, commandID);
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Get the permissions for all commands in a guild.
|
|
175
|
-
* @param guildID The ID of the guild.
|
|
176
|
-
*/
|
|
177
|
-
async getGuildPermissions(guildID) {
|
|
178
|
-
return this.client.rest.applications.getGuildPermissions(this.id, guildID);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Get this application's role connection metadata records.
|
|
182
|
-
*/
|
|
183
|
-
async getRoleConnectionsMetadata() {
|
|
184
|
-
return this.client.rest.oauth.getRoleConnectionsMetadata(this.id);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Get the SKUs for this application.
|
|
188
|
-
*/
|
|
189
|
-
async getSKUs() {
|
|
190
|
-
return this.client.rest.applications.getSKUs(this.id);
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Get the authenticated user's role connection object for this application. This requires the `role_connections.write` scope.
|
|
194
|
-
*/
|
|
195
|
-
async getUserRoleConnection() {
|
|
196
|
-
return this.client.rest.oauth.getUserRoleConnection(this.id);
|
|
197
|
-
}
|
|
198
|
-
toJSON() {
|
|
199
|
-
return {
|
|
200
|
-
...super.toJSON(),
|
|
201
|
-
flags: this.flags
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Update this application's role connections metadata.
|
|
206
|
-
* @param metadata The metadata records.
|
|
207
|
-
*/
|
|
208
|
-
async updateRoleConnectionsMetadata(metadata) {
|
|
209
|
-
return this.client.rest.oauth.updateRoleConnectionsMetadata(this.id, metadata);
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Update the authenticated user's role connection object for an application. This requires the `role_connections.write` scope.
|
|
213
|
-
* @param data The metadata to update.
|
|
214
|
-
*/
|
|
215
|
-
async updateUserRoleConnection(data) {
|
|
216
|
-
return this.client.rest.oauth.updateUserRoleConnection(this.id, data);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
exports.default = ClientApplication;
|
|
220
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2xpZW50QXBwbGljYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9saWIvc3RydWN0dXJlcy9DbGllbnRBcHBsaWNhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxnQ0FBZ0M7QUFDaEMsMERBQTBCO0FBRTFCLGdGQUFnRDtBQUNoRCx3RUFBd0M7QUFDeEMsZ0ZBQWdEO0FBd0JoRCxzRkFBc0Q7QUFFdEQsZ0dBQWdHO0FBQ2hHLE1BQXFCLGlCQUFrQixTQUFRLGNBQUk7SUFDL0MscUpBQXFKO0lBQ3JKLFlBQVksQ0FBc0Y7SUFDbEcsa0lBQWtJO0lBQ2xJLEtBQUssQ0FBUztJQUNkLFlBQVksSUFBMEIsRUFBRSxNQUFjO1FBQ2xELEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLE1BQU0sQ0FBQyxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxZQUFZLEdBQUcsSUFBSSx5QkFBZSxDQUFDLHlCQUFlLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRTtZQUN2RSxTQUFTLEVBQUUsQ0FBQyxXQUFXLEVBQW1CLEVBQUU7Z0JBQ3hDLElBQUksaUJBQWlCLElBQUksV0FBVyxJQUFJLFdBQVcsQ0FBQyxlQUFlLEVBQUUsQ0FBQztvQkFDbEUsT0FBTyxJQUFJLHFCQUFXLENBQUMsV0FBNkIsRUFBRSxNQUFNLENBQUMsQ0FBQztnQkFDbEUsQ0FBQztnQkFFRCxPQUFPLElBQUkseU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BQUMsS0FBSztTQUNwQixDQUFDO0lBQ04sQ0FBQztJQUVEOzs7T0FHRztJQUNILEtBQUssQ0FBQyw2QkFBNkIsQ0FBQyxRQUF1QztRQUN2RSxPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyw2QkFBNkIsQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLFFBQVEsQ0FBQyxDQUFDO0lBQ25GLENBQUM7SUFFRDs7O09BR0c7SUFDSCxLQUFLLENBQUMsd0JBQXdCLENBQUMsSUFBZ0Q7UUFDM0UsT0FBTyxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsd0JBQXdCLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUMxRSxDQUFDO0NBQ0o7QUExT0Qsb0NBME9DIn0=
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/** @module CommandInteraction */
|
|
2
|
-
import Interaction from "./Interaction";
|
|
3
|
-
import Member from "./Member";
|
|
4
|
-
import Message from "./Message";
|
|
5
|
-
import User from "./User";
|
|
6
|
-
import type Guild from "./Guild";
|
|
7
|
-
import Permission from "./Permission";
|
|
8
|
-
import type PrivateChannel from "./PrivateChannel";
|
|
9
|
-
import type Entitlement from "./Entitlement";
|
|
10
|
-
import type TestEntitlement from "./TestEntitlement";
|
|
11
|
-
import { ApplicationCommandTypes, type InteractionTypes, type InteractionContextTypes } from "../Constants";
|
|
12
|
-
import type { ApplicationCommandInteractionData, InteractionContent, ModalData, RawApplicationCommandInteraction, InitialInteractionContent, InteractionGuild, AuthorizingIntegrationOwners } from "../types/interactions";
|
|
13
|
-
import type Client from "../Client";
|
|
14
|
-
import type { AnyTextableGuildChannel, AnyInteractionChannel } from "../types/channels";
|
|
15
|
-
import type { JSONCommandInteraction } from "../types/json";
|
|
16
|
-
import type { Uncached } from "../types/shared";
|
|
17
|
-
import MessageInteractionResponse, { type FollowupMessageInteractionResponse, type InitialMessagedInteractionResponse } from "../util/interactions/MessageInteractionResponse";
|
|
18
|
-
/** Represents a command interaction. */
|
|
19
|
-
export default class CommandInteraction<T extends AnyInteractionChannel | Uncached = AnyInteractionChannel | Uncached, C extends ApplicationCommandTypes = ApplicationCommandTypes> extends Interaction {
|
|
20
|
-
private _cachedChannel;
|
|
21
|
-
private _cachedGuild?;
|
|
22
|
-
/** The permissions the bot has in the channel this interaction was sent from. If in a dm/group dm, this will contain `ATTACH_FILES`, `EMBED_LINKS`, and `MENTION_EVERYONE`. In addition, `USE_EXTERNAL_EMOJIS` will be included for DMs with the app's bot user. */
|
|
23
|
-
appPermissions: Permission;
|
|
24
|
-
/** Details about the authorizing user or server for the installation(s) relevant to the interaction. See [Discord's docs](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object) for more information. */
|
|
25
|
-
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
|
26
|
-
/** The ID of the channel this interaction was sent from. */
|
|
27
|
-
channelID: string;
|
|
28
|
-
/** The context this interaction was sent from. */
|
|
29
|
-
context?: InteractionContextTypes;
|
|
30
|
-
/** The data associated with the interaction. */
|
|
31
|
-
data: ApplicationCommandInteractionData<T, C>;
|
|
32
|
-
/** The entitlements for the user that created this interaction, and the guild it was created in. */
|
|
33
|
-
entitlements: Array<Entitlement | TestEntitlement>;
|
|
34
|
-
/** The id of the guild this interaction was sent from, if applicable. */
|
|
35
|
-
guildID: T extends AnyTextableGuildChannel ? string : string | null;
|
|
36
|
-
/** The preferred [locale](https://discord.com/developers/docs/reference#locales) of the guild this interaction was sent from, if applicable. */
|
|
37
|
-
guildLocale: T extends AnyTextableGuildChannel ? string : string | undefined;
|
|
38
|
-
/** The partial guild this interaction was sent from, if applicable. */
|
|
39
|
-
guildPartial?: T extends AnyTextableGuildChannel ? InteractionGuild : InteractionGuild | undefined;
|
|
40
|
-
/** The [locale](https://discord.com/developers/docs/reference#locales) of the invoking user. */
|
|
41
|
-
locale: string;
|
|
42
|
-
/** The member associated with the invoking user, if this interaction is sent from a guild. */
|
|
43
|
-
member: T extends AnyTextableGuildChannel ? Member : Member | null;
|
|
44
|
-
/** The permissions of the member associated with the invoking user, if this interaction is sent from a guild. */
|
|
45
|
-
memberPermissions: T extends AnyTextableGuildChannel ? Permission : Permission | null;
|
|
46
|
-
type: InteractionTypes.APPLICATION_COMMAND;
|
|
47
|
-
/** The user that invoked this interaction. */
|
|
48
|
-
user: User;
|
|
49
|
-
constructor(data: RawApplicationCommandInteraction, client: Client);
|
|
50
|
-
/** The channel this interaction was sent from. */
|
|
51
|
-
get channel(): T extends AnyInteractionChannel ? T : undefined;
|
|
52
|
-
/** The guild this interaction was sent from, if applicable. This will throw an error if the guild is not cached. */
|
|
53
|
-
get guild(): T extends AnyTextableGuildChannel ? Guild : Guild | null;
|
|
54
|
-
/**
|
|
55
|
-
* Create a followup message. Note that the returned class is not a message. The message is located in the property {@link MessageInteractionResponse#message | message}.
|
|
56
|
-
* @param options The options for creating the followup message.
|
|
57
|
-
*/
|
|
58
|
-
createFollowup(options: InteractionContent): Promise<FollowupMessageInteractionResponse<this>>;
|
|
59
|
-
/**
|
|
60
|
-
* Create a message through this interaction. This is an initial response, and more than one initial response cannot be used. Use {@link CommandInteraction#createFollowup | createFollowup}.
|
|
61
|
-
* Note that the returned class is not a message. This initial response does not return a message. You will need to call {@link MessageInteractionResponse#getMessage | MessageInteractionResponse#getMessage} on the returned class,
|
|
62
|
-
* or {@link CommandInteraction#getOriginal | getOriginal}.
|
|
63
|
-
* @note You cannot attach files in an initial response. Defer the interaction, then use {@link CommandInteraction#createFollowup | createFollowup}.
|
|
64
|
-
* @param options The options for the message.
|
|
65
|
-
*/
|
|
66
|
-
createMessage(options: InitialInteractionContent): Promise<InitialMessagedInteractionResponse<this>>;
|
|
67
|
-
/**
|
|
68
|
-
* Respond to this interaction with a modal. This is an initial response, and more than one initial response cannot be used.
|
|
69
|
-
* @param options The options for the modal.
|
|
70
|
-
*/
|
|
71
|
-
createModal(options: ModalData): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Defer this interaction. This is an initial response, and more than one initial response cannot be used.
|
|
74
|
-
* @param flags The [flags](https://discord.com/developers/docs/resources/channel#message-object-message-flags) to respond with.
|
|
75
|
-
*/
|
|
76
|
-
defer(flags?: number): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Delete a follow-up message.
|
|
79
|
-
* @param messageID The ID of the message.
|
|
80
|
-
*/
|
|
81
|
-
deleteFollowup(messageID: string): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Delete the original interaction response.
|
|
84
|
-
*/
|
|
85
|
-
deleteOriginal(): Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* Edit a followup message.
|
|
88
|
-
* @param messageID The ID of the message.
|
|
89
|
-
* @param options The options for editing the followup message.
|
|
90
|
-
*/
|
|
91
|
-
editFollowup(messageID: string, options: InteractionContent): Promise<Message<T>>;
|
|
92
|
-
/**
|
|
93
|
-
* Edit the original interaction response.
|
|
94
|
-
* @param options The options for editing the original message.
|
|
95
|
-
*/
|
|
96
|
-
editOriginal(options: InteractionContent): Promise<Message<T>>;
|
|
97
|
-
/**
|
|
98
|
-
* Get a followup message.
|
|
99
|
-
* @param messageID The ID of the message.
|
|
100
|
-
*/
|
|
101
|
-
getFollowup(messageID: string): Promise<Message<T>>;
|
|
102
|
-
/**
|
|
103
|
-
* Get the original interaction response.
|
|
104
|
-
*/
|
|
105
|
-
getOriginal(): Promise<Message<T>>;
|
|
106
|
-
/** Whether this interaction belongs to a cached guild channel. The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
|
|
107
|
-
inCachedGuildChannel(): this is CommandInteraction<AnyTextableGuildChannel>;
|
|
108
|
-
/** Whether this interaction belongs to a private channel (PrivateChannel or uncached). The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
|
|
109
|
-
inPrivateChannel(): this is CommandInteraction<PrivateChannel | Uncached>;
|
|
110
|
-
/** A type guard, checking if this command interaction is a {@link Constants~ApplicationCommandTypes.CHAT_INPUT | Chat Input} command. */
|
|
111
|
-
isChatInputCommand(): this is CommandInteraction<T, ApplicationCommandTypes.CHAT_INPUT>;
|
|
112
|
-
/** A type guard, checking if this command interaction is a {@link Constants~ApplicationCommandTypes.MESSAGE | Message} command. */
|
|
113
|
-
isMessageCommand(): this is CommandInteraction<T, ApplicationCommandTypes.MESSAGE>;
|
|
114
|
-
/** A type guard, checking if this command interaction is a {@link Constants~ApplicationCommandTypes.USER | User} command. */
|
|
115
|
-
isUserCommand(): this is CommandInteraction<T, ApplicationCommandTypes.USER>;
|
|
116
|
-
/** Show a "premium required" response to the user. This is an initial response, and more than one initial response cannot be used. */
|
|
117
|
-
premiumRequired(): Promise<void>;
|
|
118
|
-
/**
|
|
119
|
-
* Reply to this interaction. If the interaction hasn't been acknowledged, {@link CommandInteraction#createMessage | createMessage} is used. Else, {@link CommandInteraction#createFollowup | createFollowup} is used.
|
|
120
|
-
* Note the returned class is not a message. Depending on which method was used, the returned class may or may not have the sent message. {@link MessageInteractionResponse#hasMessage | hasMessage} can be used for type narrowing
|
|
121
|
-
* to check if {@link MessageInteractionResponse#message | message} is present. If it is not, the {@link MessageInteractionResponse#getMessage | getMessage} can be used.
|
|
122
|
-
* @note Due to atachments not being able to be sent in initial responses, attachments will cause a deferred response, if the interaction has not been acknowledged.
|
|
123
|
-
* @param options The options for the message.
|
|
124
|
-
*/
|
|
125
|
-
reply(options: InteractionContent): Promise<MessageInteractionResponse<this>>;
|
|
126
|
-
toJSON(): JSONCommandInteraction;
|
|
127
|
-
}
|