@buape/carbon 0.0.0-beta-20241008010229
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/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/package.json +34 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts +31 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenu.js +19 -0
- package/dist/src/abstracts/AnySelectMenu.js.map +1 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts +13 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.js +21 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/Base.d.ts +10 -0
- package/dist/src/abstracts/Base.d.ts.map +1 -0
- package/dist/src/abstracts/Base.js +11 -0
- package/dist/src/abstracts/Base.js.map +1 -0
- package/dist/src/abstracts/BaseChannel.d.ts +45 -0
- package/dist/src/abstracts/BaseChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseChannel.js +68 -0
- package/dist/src/abstracts/BaseChannel.js.map +1 -0
- package/dist/src/abstracts/BaseCommand.d.ts +58 -0
- package/dist/src/abstracts/BaseCommand.d.ts.map +1 -0
- package/dist/src/abstracts/BaseCommand.js +72 -0
- package/dist/src/abstracts/BaseCommand.js.map +1 -0
- package/dist/src/abstracts/BaseComponent.d.ts +34 -0
- package/dist/src/abstracts/BaseComponent.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponent.js +30 -0
- package/dist/src/abstracts/BaseComponent.js.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +19 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.js +42 -0
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts +70 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.js +143 -0
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts +46 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js +77 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js.map +1 -0
- package/dist/src/abstracts/BaseInteraction.d.ts +92 -0
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseInteraction.js +152 -0
- package/dist/src/abstracts/BaseInteraction.js.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +43 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js +69 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -0
- package/dist/src/classes/Button.d.ts +49 -0
- package/dist/src/classes/Button.d.ts.map +1 -0
- package/dist/src/classes/Button.js +61 -0
- package/dist/src/classes/Button.js.map +1 -0
- package/dist/src/classes/ChannelSelectMenu.d.ts +15 -0
- package/dist/src/classes/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/ChannelSelectMenu.js +15 -0
- package/dist/src/classes/ChannelSelectMenu.js.map +1 -0
- package/dist/src/classes/Client.d.ts +180 -0
- package/dist/src/classes/Client.d.ts.map +1 -0
- package/dist/src/classes/Client.js +263 -0
- package/dist/src/classes/Client.js.map +1 -0
- package/dist/src/classes/Command.d.ts +33 -0
- package/dist/src/classes/Command.d.ts.map +1 -0
- package/dist/src/classes/Command.js +31 -0
- package/dist/src/classes/Command.js.map +1 -0
- package/dist/src/classes/CommandWithSubcommandGroups.d.ts +22 -0
- package/dist/src/classes/CommandWithSubcommandGroups.d.ts.map +1 -0
- package/dist/src/classes/CommandWithSubcommandGroups.js +31 -0
- package/dist/src/classes/CommandWithSubcommandGroups.js.map +1 -0
- package/dist/src/classes/CommandWithSubcommands.d.ts +19 -0
- package/dist/src/classes/CommandWithSubcommands.d.ts.map +1 -0
- package/dist/src/classes/CommandWithSubcommands.js +21 -0
- package/dist/src/classes/CommandWithSubcommands.js.map +1 -0
- package/dist/src/classes/Embed.d.ts +61 -0
- package/dist/src/classes/Embed.d.ts.map +1 -0
- package/dist/src/classes/Embed.js +75 -0
- package/dist/src/classes/Embed.js.map +1 -0
- package/dist/src/classes/MentionableSelectMenu.d.ts +13 -0
- package/dist/src/classes/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/MentionableSelectMenu.js +13 -0
- package/dist/src/classes/MentionableSelectMenu.js.map +1 -0
- package/dist/src/classes/Modal.d.ts +21 -0
- package/dist/src/classes/Modal.d.ts.map +1 -0
- package/dist/src/classes/Modal.js +14 -0
- package/dist/src/classes/Modal.js.map +1 -0
- package/dist/src/classes/RoleSelectMenu.d.ts +13 -0
- package/dist/src/classes/RoleSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/RoleSelectMenu.js +13 -0
- package/dist/src/classes/RoleSelectMenu.js.map +1 -0
- package/dist/src/classes/Row.d.ts +25 -0
- package/dist/src/classes/Row.d.ts.map +1 -0
- package/dist/src/classes/Row.js +40 -0
- package/dist/src/classes/Row.js.map +1 -0
- package/dist/src/classes/StringSelectMenu.d.ts +13 -0
- package/dist/src/classes/StringSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/StringSelectMenu.js +12 -0
- package/dist/src/classes/StringSelectMenu.js.map +1 -0
- package/dist/src/classes/TextInput.d.ts +40 -0
- package/dist/src/classes/TextInput.d.ts.map +1 -0
- package/dist/src/classes/TextInput.js +44 -0
- package/dist/src/classes/TextInput.js.map +1 -0
- package/dist/src/classes/UserSelectMenu.d.ts +13 -0
- package/dist/src/classes/UserSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/UserSelectMenu.js +13 -0
- package/dist/src/classes/UserSelectMenu.js.map +1 -0
- package/dist/src/factories/channelFactory.d.ts +13 -0
- package/dist/src/factories/channelFactory.d.ts.map +1 -0
- package/dist/src/factories/channelFactory.js +39 -0
- package/dist/src/factories/channelFactory.js.map +1 -0
- package/dist/src/index.d.ts +55 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +61 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts +33 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.js +61 -0
- package/dist/src/internals/AutocompleteInteraction.js.map +1 -0
- package/dist/src/internals/ButtonInteraction.d.ts +9 -0
- package/dist/src/internals/ButtonInteraction.d.ts.map +1 -0
- package/dist/src/internals/ButtonInteraction.js +18 -0
- package/dist/src/internals/ButtonInteraction.js.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts +8 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.js +11 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/CommandHandler.d.ts +12 -0
- package/dist/src/internals/CommandHandler.d.ts.map +1 -0
- package/dist/src/internals/CommandHandler.js +89 -0
- package/dist/src/internals/CommandHandler.js.map +1 -0
- package/dist/src/internals/CommandInteraction.d.ts +16 -0
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -0
- package/dist/src/internals/CommandInteraction.js +23 -0
- package/dist/src/internals/CommandInteraction.js.map +1 -0
- package/dist/src/internals/ComponentHandler.d.ts +17 -0
- package/dist/src/internals/ComponentHandler.d.ts.map +1 -0
- package/dist/src/internals/ComponentHandler.js +75 -0
- package/dist/src/internals/ComponentHandler.js.map +1 -0
- package/dist/src/internals/FieldsHandler.d.ts +27 -0
- package/dist/src/internals/FieldsHandler.d.ts.map +1 -0
- package/dist/src/internals/FieldsHandler.js +37 -0
- package/dist/src/internals/FieldsHandler.js.map +1 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.js +15 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/ModalHandler.d.ts +17 -0
- package/dist/src/internals/ModalHandler.d.ts.map +1 -0
- package/dist/src/internals/ModalHandler.js +25 -0
- package/dist/src/internals/ModalHandler.js.map +1 -0
- package/dist/src/internals/ModalInteraction.d.ts +22 -0
- package/dist/src/internals/ModalInteraction.d.ts.map +1 -0
- package/dist/src/internals/ModalInteraction.js +42 -0
- package/dist/src/internals/ModalInteraction.js.map +1 -0
- package/dist/src/internals/OptionsHandler.d.ts +82 -0
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -0
- package/dist/src/internals/OptionsHandler.js +127 -0
- package/dist/src/internals/OptionsHandler.js.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.js +14 -0
- package/dist/src/internals/RoleSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/StringSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/StringSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/StringSelectMenuInteraction.js +14 -0
- package/dist/src/internals/StringSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/UserSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/UserSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/UserSelectMenuInteraction.js +14 -0
- package/dist/src/internals/UserSelectMenuInteraction.js.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts +49 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js +164 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js.map +1 -0
- package/dist/src/plugins/linked-roles/index.d.ts +3 -0
- package/dist/src/plugins/linked-roles/index.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/index.js +3 -0
- package/dist/src/plugins/linked-roles/index.js.map +1 -0
- package/dist/src/plugins/linked-roles/types.d.ts +88 -0
- package/dist/src/plugins/linked-roles/types.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/types.js +39 -0
- package/dist/src/plugins/linked-roles/types.js.map +1 -0
- package/dist/src/structures/DmChannel.d.ts +19 -0
- package/dist/src/structures/DmChannel.d.ts.map +1 -0
- package/dist/src/structures/DmChannel.js +25 -0
- package/dist/src/structures/DmChannel.js.map +1 -0
- package/dist/src/structures/GroupDmChannel.d.ts +65 -0
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -0
- package/dist/src/structures/GroupDmChannel.js +116 -0
- package/dist/src/structures/GroupDmChannel.js.map +1 -0
- package/dist/src/structures/Guild.d.ts +77 -0
- package/dist/src/structures/Guild.d.ts.map +1 -0
- package/dist/src/structures/Guild.js +156 -0
- package/dist/src/structures/Guild.js.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts +11 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.js +15 -0
- package/dist/src/structures/GuildAnnouncementChannel.js.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts +13 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.js +13 -0
- package/dist/src/structures/GuildCategoryChannel.js.map +1 -0
- package/dist/src/structures/GuildForumChannel.d.ts +14 -0
- package/dist/src/structures/GuildForumChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildForumChannel.js +15 -0
- package/dist/src/structures/GuildForumChannel.js.map +1 -0
- package/dist/src/structures/GuildMediaChannel.d.ts +9 -0
- package/dist/src/structures/GuildMediaChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildMediaChannel.js +7 -0
- package/dist/src/structures/GuildMediaChannel.js.map +1 -0
- package/dist/src/structures/GuildMember.d.ts +111 -0
- package/dist/src/structures/GuildMember.d.ts.map +1 -0
- package/dist/src/structures/GuildMember.js +224 -0
- package/dist/src/structures/GuildMember.js.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +31 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js +43 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js.map +1 -0
- package/dist/src/structures/GuildTextChannel.d.ts +15 -0
- package/dist/src/structures/GuildTextChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildTextChannel.js +20 -0
- package/dist/src/structures/GuildTextChannel.js.map +1 -0
- package/dist/src/structures/GuildThreadChannel.d.ts +90 -0
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildThreadChannel.js +165 -0
- package/dist/src/structures/GuildThreadChannel.js.map +1 -0
- package/dist/src/structures/Message.d.ts +153 -0
- package/dist/src/structures/Message.d.ts.map +1 -0
- package/dist/src/structures/Message.js +296 -0
- package/dist/src/structures/Message.js.map +1 -0
- package/dist/src/structures/Role.d.ts +108 -0
- package/dist/src/structures/Role.d.ts.map +1 -0
- package/dist/src/structures/Role.js +220 -0
- package/dist/src/structures/Role.js.map +1 -0
- package/dist/src/structures/User.d.ts +82 -0
- package/dist/src/structures/User.d.ts.map +1 -0
- package/dist/src/structures/User.js +166 -0
- package/dist/src/structures/User.js.map +1 -0
- package/dist/src/types.d.ts +37 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils.d.ts +22 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +79 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { InteractionResponseType, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { serializePayload, splitCustomId } from "../utils.js";
|
|
3
|
+
import { BaseInteraction } from "./BaseInteraction.js";
|
|
4
|
+
export class BaseComponentInteraction extends BaseInteraction {
|
|
5
|
+
customId;
|
|
6
|
+
componentType;
|
|
7
|
+
constructor(client, data, defaults) {
|
|
8
|
+
super(client, data, defaults);
|
|
9
|
+
if (!data.data)
|
|
10
|
+
throw new Error("Invalid interaction data was used to create this class");
|
|
11
|
+
this.customId = splitCustomId(data.data.custom_id)[0];
|
|
12
|
+
this.componentType = data.data.component_type;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Acknowledge the interaction, the user does not see a loading state.
|
|
16
|
+
* This can only be used for component interactions
|
|
17
|
+
*/
|
|
18
|
+
async acknowledge() {
|
|
19
|
+
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
20
|
+
body: {
|
|
21
|
+
type: InteractionResponseType.DeferredMessageUpdate
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this._deferred = true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Update the original message of the component
|
|
28
|
+
*/
|
|
29
|
+
async update(data, options = {}) {
|
|
30
|
+
const serialized = serializePayload(data);
|
|
31
|
+
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
32
|
+
body: {
|
|
33
|
+
type: InteractionResponseType.UpdateMessage,
|
|
34
|
+
data: {
|
|
35
|
+
...serialized
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
files: options.files
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=BaseComponentInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponentInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,E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,KAAK,CAAC,EAC/D;YACC,IAAI,EAAE;gBACL,IAAI,EAAE,uBAAuB,CAAC,aAAa;gBAC3C,IAAI,EAAE;oBACL,GAAG,UAAU;iBACb;aACyC;YAC3C,KAAK,EAAE,OAAO,CAAC,KAAK;SACpB,CACD,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type APIGuildChannel, type GuildChannelType, type RESTGetAPIGuildInvitesResult, type RESTPostAPIChannelInviteJSONBody } from "discord-api-types/v10";
|
|
2
|
+
import { Guild } from "../structures/Guild.js";
|
|
3
|
+
import type { GuildCategoryChannel } from "../structures/GuildCategoryChannel.js";
|
|
4
|
+
import type { MessagePayload } from "../types.js";
|
|
5
|
+
import type { IfPartial } from "../utils.js";
|
|
6
|
+
import { BaseChannel } from "./BaseChannel.js";
|
|
7
|
+
export declare abstract class BaseGuildChannel<Type extends GuildChannelType, IsPartial extends boolean = false> extends BaseChannel<Type, IsPartial> {
|
|
8
|
+
rawData: APIGuildChannel<Type> | null;
|
|
9
|
+
/**
|
|
10
|
+
* The name of the channel.
|
|
11
|
+
*/
|
|
12
|
+
get name(): IfPartial<IsPartial, string>;
|
|
13
|
+
/**
|
|
14
|
+
* The ID of the guild this channel is in
|
|
15
|
+
*/
|
|
16
|
+
get guildId(): IfPartial<IsPartial, string>;
|
|
17
|
+
/**
|
|
18
|
+
* The position of the channel in the channel list.
|
|
19
|
+
*/
|
|
20
|
+
get position(): IfPartial<IsPartial, number>;
|
|
21
|
+
/**
|
|
22
|
+
* The ID of the parent category for the channel.
|
|
23
|
+
*/
|
|
24
|
+
get parentId(): IfPartial<IsPartial, string | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the channel is marked as nsfw.
|
|
27
|
+
*/
|
|
28
|
+
get nsfw(): IfPartial<IsPartial, boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* The guild this channel is in
|
|
31
|
+
*/
|
|
32
|
+
get guild(): IfPartial<IsPartial, Guild<true>>;
|
|
33
|
+
/**
|
|
34
|
+
* Set the name of the channel
|
|
35
|
+
* @param name The new name of the channel
|
|
36
|
+
*/
|
|
37
|
+
setName(name: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Set the position of the channel
|
|
40
|
+
* @param position The new position of the channel
|
|
41
|
+
*/
|
|
42
|
+
setPosition(position: number): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Set the parent ID of the channel
|
|
45
|
+
* @param parent The new category channel or ID to set
|
|
46
|
+
*/
|
|
47
|
+
setParent(parent: GuildCategoryChannel | string): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Set whether the channel is nsfw
|
|
50
|
+
* @param nsfw The new nsfw status of the channel
|
|
51
|
+
*/
|
|
52
|
+
setNsfw(nsfw: boolean): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Send a message to the channel
|
|
55
|
+
*/
|
|
56
|
+
send(message: MessagePayload): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Get the invites for the channel
|
|
59
|
+
*/
|
|
60
|
+
getInvites(): Promise<RESTGetAPIGuildInvitesResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Create an invite for the channel
|
|
63
|
+
*/
|
|
64
|
+
createInvite(options?: RESTPostAPIChannelInviteJSONBody): Promise<import("discord-api-types/v10").APIExtendedInvite>;
|
|
65
|
+
/**
|
|
66
|
+
* Trigger a typing indicator in the channel (this will expire after 10 seconds)
|
|
67
|
+
*/
|
|
68
|
+
triggerTyping(): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=BaseGuildChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseGuildChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EAGrC,MAAM,uBAA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AAO,EAAE,cAAc;IAMlC;;OAEG;IACG,UAAU;IAMhB;;OAEG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,gCAAgC;IAM7D;;OAEG;IACG,aAAa;CAGnB"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Guild } from "../structures/Guild.js";
|
|
3
|
+
import { serializePayload } from "../utils.js";
|
|
4
|
+
import { BaseChannel } from "./BaseChannel.js";
|
|
5
|
+
export class BaseGuildChannel extends BaseChannel {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the channel.
|
|
8
|
+
*/
|
|
9
|
+
get name() {
|
|
10
|
+
if (!this.rawData)
|
|
11
|
+
return undefined;
|
|
12
|
+
return this.rawData.name;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the guild this channel is in
|
|
16
|
+
*/
|
|
17
|
+
get guildId() {
|
|
18
|
+
if (!this.rawData)
|
|
19
|
+
return undefined;
|
|
20
|
+
return this.rawData.guild_id;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The position of the channel in the channel list.
|
|
24
|
+
*/
|
|
25
|
+
get position() {
|
|
26
|
+
if (!this.rawData)
|
|
27
|
+
return undefined;
|
|
28
|
+
return this.rawData.position;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the parent category for the channel.
|
|
32
|
+
*/
|
|
33
|
+
get parentId() {
|
|
34
|
+
if (!this.rawData)
|
|
35
|
+
return undefined;
|
|
36
|
+
return this.rawData.parent_id ?? null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether the channel is marked as nsfw.
|
|
40
|
+
*/
|
|
41
|
+
get nsfw() {
|
|
42
|
+
if (!this.rawData)
|
|
43
|
+
return undefined;
|
|
44
|
+
return this.rawData.nsfw ?? false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The guild this channel is in
|
|
48
|
+
*/
|
|
49
|
+
get guild() {
|
|
50
|
+
if (!this.rawData)
|
|
51
|
+
return undefined;
|
|
52
|
+
if (!this.guildId)
|
|
53
|
+
throw new Error("Cannot get guild without guild ID");
|
|
54
|
+
return new Guild(this.client, this.guildId);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Set the name of the channel
|
|
58
|
+
* @param name The new name of the channel
|
|
59
|
+
*/
|
|
60
|
+
async setName(name) {
|
|
61
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
62
|
+
body: {
|
|
63
|
+
name
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.setField("name", name);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Set the position of the channel
|
|
70
|
+
* @param position The new position of the channel
|
|
71
|
+
*/
|
|
72
|
+
async setPosition(position) {
|
|
73
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
74
|
+
body: {
|
|
75
|
+
position
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this.setField("position", position);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Set the parent ID of the channel
|
|
82
|
+
* @param parent The new category channel or ID to set
|
|
83
|
+
*/
|
|
84
|
+
async setParent(parent) {
|
|
85
|
+
if (typeof parent === "string") {
|
|
86
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
87
|
+
body: {
|
|
88
|
+
parent_id: parent
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
this.setField("parent_id", parent);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
95
|
+
body: {
|
|
96
|
+
parent_id: parent.id
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
this.setField("parent_id", parent.id);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Set whether the channel is nsfw
|
|
104
|
+
* @param nsfw The new nsfw status of the channel
|
|
105
|
+
*/
|
|
106
|
+
async setNsfw(nsfw) {
|
|
107
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
108
|
+
body: {
|
|
109
|
+
nsfw
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
this.setField("nsfw", nsfw);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Send a message to the channel
|
|
116
|
+
*/
|
|
117
|
+
async send(message) {
|
|
118
|
+
this.client.rest.post(Routes.channelMessages(this.id), {
|
|
119
|
+
body: serializePayload(message)
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get the invites for the channel
|
|
124
|
+
*/
|
|
125
|
+
async getInvites() {
|
|
126
|
+
return (await this.client.rest.get(Routes.channelInvites(this.id)));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Create an invite for the channel
|
|
130
|
+
*/
|
|
131
|
+
async createInvite(options) {
|
|
132
|
+
return (await this.client.rest.post(Routes.channelInvites(this.id), {
|
|
133
|
+
body: { ...options }
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Trigger a typing indicator in the channel (this will expire after 10 seconds)
|
|
138
|
+
*/
|
|
139
|
+
async triggerTyping() {
|
|
140
|
+
await this.client.rest.post(Routes.channelTyping(this.id), {});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=BaseGuildChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseGuildChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAI9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,OAAgB,gBAGpB,S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;YACrD,IAAI,EAAE;gBACL,IAAI;aACJ;SACD,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC5B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB;QACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACtD,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC;SAC/B,CAAC,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACf,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CACjC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAC9B,CAAiC,CAAA;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,OAA0C;QAC5D,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACnE,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE;SACpB,CAAC,CAAmC,CAAA;IACtC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QAClB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;CACD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type APIGuildTextChannel, type GuildTextChannelType, type RESTPostAPIChannelThreadsJSONBody } from "discord-api-types/v10";
|
|
2
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
|
|
3
|
+
import { Message } from "../structures/Message.js";
|
|
4
|
+
import type { IfPartial } from "../utils.js";
|
|
5
|
+
import { BaseGuildChannel } from "./BaseGuildChannel.js";
|
|
6
|
+
export declare abstract class BaseGuildTextChannel<Type extends GuildTextChannelType, IsPartial extends boolean = false> extends BaseGuildChannel<Type, IsPartial> {
|
|
7
|
+
rawData: APIGuildTextChannel<Type> | null;
|
|
8
|
+
/**
|
|
9
|
+
* The topic of the channel.
|
|
10
|
+
*/
|
|
11
|
+
get topic(): IfPartial<IsPartial, string | null>;
|
|
12
|
+
/**
|
|
13
|
+
* The ID of the last message sent in the channel.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
17
|
+
*/
|
|
18
|
+
get lastMessageId(): IfPartial<IsPartial, string | null>;
|
|
19
|
+
/**
|
|
20
|
+
* The timestamp of the last pin in the channel.
|
|
21
|
+
*/
|
|
22
|
+
get lastPinTimestamp(): IfPartial<IsPartial, string | null>;
|
|
23
|
+
/**
|
|
24
|
+
* The rate limit per user for the channel, in seconds.
|
|
25
|
+
*/
|
|
26
|
+
get rateLimitPerUser(): IfPartial<IsPartial, number | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* The last message sent in the channel.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
32
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
get lastMessage(): IfPartial<IsPartial, Message<true> | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the pinned messages in the channel
|
|
38
|
+
*/
|
|
39
|
+
getPinnedMessages(): Promise<Message<false>[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Start a thread without an associated start message.
|
|
42
|
+
* If you want to start a thread with a start message, use {@link Message.startThread}
|
|
43
|
+
*/
|
|
44
|
+
startThread(data: RESTPostAPIChannelThreadsJSONBody): Promise<GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType, false>>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=BaseGuildTextChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseGuildTextChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildTextChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAEzB,KAAK,iCAAiC,EAEtC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,8BAAsB,oBAAoB,CACzC,IAAI,SAAS,oBAAoB,EACjC,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC;IAClC,OAAO,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAEjD;;OAEG;IACH,IAAI,KAAK,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAG/C;IAED;;;;;OAKG;IACH,IAAI,aAAa,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAGvD;IACD;;OAEG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAG1D;IACD;;OAEG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAG/D;IAED;;;;;;;OAOG;IACH,IAAI,WAAW,IAAI,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAO5D;IAED;;OAEG;IACG,iBAAiB;IAOvB;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,iCAAiC;CAMzD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
|
|
3
|
+
import { Message } from "../structures/Message.js";
|
|
4
|
+
import { BaseGuildChannel } from "./BaseGuildChannel.js";
|
|
5
|
+
export class BaseGuildTextChannel extends BaseGuildChannel {
|
|
6
|
+
/**
|
|
7
|
+
* The topic of the channel.
|
|
8
|
+
*/
|
|
9
|
+
get topic() {
|
|
10
|
+
if (!this.rawData)
|
|
11
|
+
return undefined;
|
|
12
|
+
return this.rawData.topic ?? null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the last message sent in the channel.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
19
|
+
*/
|
|
20
|
+
get lastMessageId() {
|
|
21
|
+
if (!this.rawData)
|
|
22
|
+
return undefined;
|
|
23
|
+
return this.rawData.last_message_id ?? null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The timestamp of the last pin in the channel.
|
|
27
|
+
*/
|
|
28
|
+
get lastPinTimestamp() {
|
|
29
|
+
if (!this.rawData)
|
|
30
|
+
return undefined;
|
|
31
|
+
return this.rawData.last_pin_timestamp ?? null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The rate limit per user for the channel, in seconds.
|
|
35
|
+
*/
|
|
36
|
+
get rateLimitPerUser() {
|
|
37
|
+
if (!this.rawData)
|
|
38
|
+
return undefined;
|
|
39
|
+
return this.rawData.rate_limit_per_user;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The last message sent in the channel.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
46
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
get lastMessage() {
|
|
50
|
+
if (!this.rawData)
|
|
51
|
+
return undefined;
|
|
52
|
+
if (!this.lastMessageId)
|
|
53
|
+
return null;
|
|
54
|
+
return new Message(this.client, {
|
|
55
|
+
id: this.lastMessageId,
|
|
56
|
+
channelId: this.id
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get the pinned messages in the channel
|
|
61
|
+
*/
|
|
62
|
+
async getPinnedMessages() {
|
|
63
|
+
const msgs = (await this.client.rest.get(Routes.channelPins(this.id)));
|
|
64
|
+
return msgs.map((x) => new Message(this.client, x));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Start a thread without an associated start message.
|
|
68
|
+
* If you want to start a thread with a start message, use {@link Message.startThread}
|
|
69
|
+
*/
|
|
70
|
+
async startThread(data) {
|
|
71
|
+
const thread = (await this.client.rest.post(Routes.threads(this.id), {
|
|
72
|
+
body: { ...data }
|
|
73
|
+
}));
|
|
74
|
+
return new GuildThreadChannel(this.client, thread);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=BaseGuildTextChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseGuildTextChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildTextChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,OAAgB,oBAGpB,SAAQ,gBAAiC;IAG1C;;OAEG;IACH,IAAI,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,OAAO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D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,IAAuC;QACxD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACpE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE;SACjB,CAAC,CAAqB,CAAA;QACvB,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnD,CAAC;CACD"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type APIInteraction, type InteractionType } from "discord-api-types/v10";
|
|
2
|
+
import { Base, type Client, Embed, Guild, Message, type Modal, User } from "../index.js";
|
|
3
|
+
import { GuildMember } from "../structures/GuildMember.js";
|
|
4
|
+
import type { MessagePayload } from "../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Additional options for replying to an interaction
|
|
7
|
+
*/
|
|
8
|
+
export type InteractionReplyOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* The files to send in the interaction
|
|
11
|
+
*/
|
|
12
|
+
files?: InteractionFileData[];
|
|
13
|
+
/**
|
|
14
|
+
* Whether the interaction should be ephemeral
|
|
15
|
+
*/
|
|
16
|
+
ephemeral?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The data for a file to send in an interaction
|
|
20
|
+
*/
|
|
21
|
+
export type InteractionFileData = {
|
|
22
|
+
/**
|
|
23
|
+
* The name of the file that will be given to Discord
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* The data of the file in a Blob
|
|
28
|
+
*/
|
|
29
|
+
data: Blob;
|
|
30
|
+
/**
|
|
31
|
+
* The alt text of the file, shown for accessibility
|
|
32
|
+
* @alpha This isn't implemented yet
|
|
33
|
+
*/
|
|
34
|
+
description?: string;
|
|
35
|
+
};
|
|
36
|
+
export type InteractionDefaults = {
|
|
37
|
+
ephemeral?: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* This is the base type interaction, all interaction types extend from this
|
|
41
|
+
*/
|
|
42
|
+
export declare abstract class BaseInteraction<T extends APIInteraction> extends Base {
|
|
43
|
+
/**
|
|
44
|
+
* The type of interaction
|
|
45
|
+
*/
|
|
46
|
+
type: InteractionType;
|
|
47
|
+
/**
|
|
48
|
+
* The raw data of the interaction
|
|
49
|
+
*/
|
|
50
|
+
rawData: T;
|
|
51
|
+
/**
|
|
52
|
+
* The user who sent the interaction
|
|
53
|
+
*/
|
|
54
|
+
userId: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the interaction is deferred already
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
_deferred: boolean;
|
|
60
|
+
private defaultEphemeral;
|
|
61
|
+
constructor(client: Client, data: T, defaults: InteractionDefaults);
|
|
62
|
+
get embeds(): Embed[] | null;
|
|
63
|
+
get message(): Message | null;
|
|
64
|
+
get guild(): Guild<true> | null;
|
|
65
|
+
get user(): User | null;
|
|
66
|
+
get channel(): import("../index.js").DmChannel<false> | import("../index.js").GroupDmChannel<false> | import("../index.js").GuildTextChannel<false> | import("../index.js").GuildVoiceChannel<false> | import("../index.js").GuildCategoryChannel<false> | import("../index.js").GuildAnnouncementChannel<false> | import("../index.js").GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType, false> | import("../index.js").GuildStageChannel<false> | import("../index.js").GuildForumChannel<false> | import("../index.js").GuildMediaChannel | null;
|
|
67
|
+
get member(): GuildMember<false, true> | null;
|
|
68
|
+
/**
|
|
69
|
+
* Reply to an interaction.
|
|
70
|
+
* If the interaction is deferred, this will edit the original response.
|
|
71
|
+
* @param data The response data
|
|
72
|
+
*/
|
|
73
|
+
reply(data: MessagePayload, options?: InteractionReplyOptions): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Defer the interaction response. This is used automatically by commands that are set to defer.
|
|
76
|
+
* If the interaction is already deferred, this will do nothing.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
defer({ ephemeral }?: {
|
|
80
|
+
ephemeral?: boolean | undefined;
|
|
81
|
+
}): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Show a modal to the user
|
|
84
|
+
* This can only be used if the interaction is not deferred
|
|
85
|
+
*/
|
|
86
|
+
showModal(modal: Modal): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Send a followup message to the interaction
|
|
89
|
+
*/
|
|
90
|
+
followUp(reply: MessagePayload, options?: InteractionReplyOptions): Promise<void>;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=BaseInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,cAAc,EAEnB,KAAK,eAAe,EAMpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,IAAI,EACJ,KAAK,MAAM,EACX,KAAK,EACL,KAAK,EACL,OAAO,EACP,KAAK,KAAK,EACV,IAAI,EAEJ,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IACV;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IACjC,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,8BAAsB,eAAe,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,IAAI;IAC3E;;OAEG;IACH,IAAI,EAAE,eAAe,CAAA;IACrB;;OAEG;IACH,OAAO,EAAE,CAAC,CAAA;IACV;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAE1B;;;OAGG;IACH,SAAS,UAAQ;IAEjB,OAAO,CAAC,gBAAgB,CAAQ;gBAEpB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,mBAAmB;IASlE,IAAI,MAAM,IAAI,KAAK,EAAE,GAAG,IAAI,CAG3B;IAED,IAAI,OAAO,IAAI,OAAO,GAAG,IAAI,CAG5B;IAED,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAG9B;IAED,IAAI,IAAI,IAAI,IAAI,GAAG,IAAI,CAKtB;IAED,IAAI,OAAO,8hBAGV;IAED,IAAI,MAAM,oCAIT;IAED;;;;OAIG;IACG,KAAK,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,GAAE,uBAA4B;IAqCvE;;;;OAIG;IACG,KAAK,CAAC,EAAE,SAAiB,EAAE;;KAAK;IAmBtC;;;OAGG;IACG,SAAS,CAAC,KAAK,EAAE,KAAK;IAc5B;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,uBAA4B;CAgB3E"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { InteractionResponseType, MessageFlags, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Base, Embed, Guild, Message, User, channelFactory } from "../index.js";
|
|
3
|
+
import { GuildMember } from "../structures/GuildMember.js";
|
|
4
|
+
import { serializePayload } from "../utils.js";
|
|
5
|
+
/**
|
|
6
|
+
* This is the base type interaction, all interaction types extend from this
|
|
7
|
+
*/
|
|
8
|
+
export class BaseInteraction extends Base {
|
|
9
|
+
/**
|
|
10
|
+
* The type of interaction
|
|
11
|
+
*/
|
|
12
|
+
type;
|
|
13
|
+
/**
|
|
14
|
+
* The raw data of the interaction
|
|
15
|
+
*/
|
|
16
|
+
rawData;
|
|
17
|
+
/**
|
|
18
|
+
* The user who sent the interaction
|
|
19
|
+
*/
|
|
20
|
+
userId;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the interaction is deferred already
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
_deferred = false;
|
|
26
|
+
defaultEphemeral = false;
|
|
27
|
+
constructor(client, data, defaults) {
|
|
28
|
+
super(client);
|
|
29
|
+
this.rawData = data;
|
|
30
|
+
this.type = data.type;
|
|
31
|
+
this.userId =
|
|
32
|
+
this.rawData.user?.id || this.rawData.member?.user.id || undefined;
|
|
33
|
+
if (defaults.ephemeral)
|
|
34
|
+
this.defaultEphemeral = defaults.ephemeral;
|
|
35
|
+
}
|
|
36
|
+
get embeds() {
|
|
37
|
+
if (!this.rawData.message)
|
|
38
|
+
return null;
|
|
39
|
+
return this.rawData.message.embeds.map((embed) => new Embed(embed));
|
|
40
|
+
}
|
|
41
|
+
get message() {
|
|
42
|
+
if (!this.rawData.message)
|
|
43
|
+
return null;
|
|
44
|
+
return new Message(this.client, this.rawData.message);
|
|
45
|
+
}
|
|
46
|
+
get guild() {
|
|
47
|
+
if (!this.rawData.guild_id)
|
|
48
|
+
return null;
|
|
49
|
+
return new Guild(this.client, this.rawData.guild_id);
|
|
50
|
+
}
|
|
51
|
+
get user() {
|
|
52
|
+
if (this.rawData.user)
|
|
53
|
+
return new User(this.client, this.rawData.user);
|
|
54
|
+
if (this.rawData.member)
|
|
55
|
+
return new User(this.client, this.rawData.member.user);
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
get channel() {
|
|
59
|
+
if (!this.rawData.channel)
|
|
60
|
+
return null;
|
|
61
|
+
return channelFactory(this.client, this.rawData.channel);
|
|
62
|
+
}
|
|
63
|
+
get member() {
|
|
64
|
+
if (!this.rawData.member)
|
|
65
|
+
return null;
|
|
66
|
+
if (!this.guild)
|
|
67
|
+
return null;
|
|
68
|
+
return new GuildMember(this.client, this.rawData.member, this.guild);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Reply to an interaction.
|
|
72
|
+
* If the interaction is deferred, this will edit the original response.
|
|
73
|
+
* @param data The response data
|
|
74
|
+
*/
|
|
75
|
+
async reply(data, options = {}) {
|
|
76
|
+
const serialized = serializePayload(data);
|
|
77
|
+
if (this._deferred) {
|
|
78
|
+
await this.client.rest.patch(Routes.webhookMessage(this.client.options.clientId, this.rawData.token, "@original"), {
|
|
79
|
+
body: {
|
|
80
|
+
...serialized
|
|
81
|
+
},
|
|
82
|
+
files: options.files
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
87
|
+
body: {
|
|
88
|
+
type: InteractionResponseType.ChannelMessageWithSource,
|
|
89
|
+
data: {
|
|
90
|
+
...serialized,
|
|
91
|
+
flags: options.ephemeral || this.defaultEphemeral
|
|
92
|
+
? MessageFlags.Ephemeral |
|
|
93
|
+
("flags" in serialized ? (serialized.flags ?? 0) : 0)
|
|
94
|
+
: undefined
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
files: options.files
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Defer the interaction response. This is used automatically by commands that are set to defer.
|
|
103
|
+
* If the interaction is already deferred, this will do nothing.
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
async defer({ ephemeral = false } = {}) {
|
|
107
|
+
if (this._deferred)
|
|
108
|
+
return;
|
|
109
|
+
this._deferred = true;
|
|
110
|
+
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
111
|
+
body: {
|
|
112
|
+
type: InteractionResponseType.DeferredChannelMessageWithSource,
|
|
113
|
+
data: {
|
|
114
|
+
flags: ephemeral || this.defaultEphemeral
|
|
115
|
+
? MessageFlags.Ephemeral
|
|
116
|
+
: undefined
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Show a modal to the user
|
|
123
|
+
* This can only be used if the interaction is not deferred
|
|
124
|
+
*/
|
|
125
|
+
async showModal(modal) {
|
|
126
|
+
if (this._deferred)
|
|
127
|
+
throw new Error("You cannot defer an interaction that shows a modal");
|
|
128
|
+
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
129
|
+
body: {
|
|
130
|
+
type: InteractionResponseType.Modal,
|
|
131
|
+
data: modal.serialize()
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Send a followup message to the interaction
|
|
137
|
+
*/
|
|
138
|
+
async followUp(reply, options = {}) {
|
|
139
|
+
const serialized = serializePayload(reply);
|
|
140
|
+
await this.client.rest.post(Routes.webhook(this.client.options.clientId, this.rawData.token), {
|
|
141
|
+
body: {
|
|
142
|
+
...serialized,
|
|
143
|
+
flags: options.ephemeral
|
|
144
|
+
? MessageFlags.Ephemeral |
|
|
145
|
+
("flags" in serialized ? (serialized.flags ?? 0) : 0)
|
|
146
|
+
: undefined
|
|
147
|
+
},
|
|
148
|
+
files: options.files
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=BaseInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/BaseInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,uBAAuB,EAEvB,YAAY,EAIZ,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,IAAI,EAEJ,K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