@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,43 @@
|
|
|
1
|
+
import type { APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIThreadOnlyChannel, ChannelType, SortOrderType } from "discord-api-types/v10";
|
|
2
|
+
import type { MessagePayload } from "../types.js";
|
|
3
|
+
import type { IfPartial } from "../utils.js";
|
|
4
|
+
import { BaseGuildChannel } from "./BaseGuildChannel.js";
|
|
5
|
+
export declare abstract class GuildThreadOnlyChannel<Type extends ChannelType.GuildForum | ChannelType.GuildMedia, IsPartial extends boolean = false> extends BaseGuildChannel<Type, IsPartial> {
|
|
6
|
+
rawData: APIThreadOnlyChannel<Type> | null;
|
|
7
|
+
/**
|
|
8
|
+
* The topic of the channel.
|
|
9
|
+
*/
|
|
10
|
+
get topic(): IfPartial<IsPartial, string | null>;
|
|
11
|
+
/**
|
|
12
|
+
* The default auto archive duration of the channel.
|
|
13
|
+
*/
|
|
14
|
+
get defaultAutoArchiveDuration(): IfPartial<IsPartial, number | null>;
|
|
15
|
+
/**
|
|
16
|
+
* The default thread rate limit per user for the channel.
|
|
17
|
+
*/
|
|
18
|
+
get defaultThreadRateLimitPerUser(): IfPartial<IsPartial, number | null>;
|
|
19
|
+
/**
|
|
20
|
+
* The available tags to set on posts in the channel.
|
|
21
|
+
*/
|
|
22
|
+
get availableTags(): IfPartial<IsPartial, APIGuildForumTag[]>;
|
|
23
|
+
/**
|
|
24
|
+
* The default reaction emoji for the channel.
|
|
25
|
+
*/
|
|
26
|
+
get defaultReactionEmoji(): IfPartial<IsPartial, APIGuildForumDefaultReactionEmoji | null>;
|
|
27
|
+
/**
|
|
28
|
+
* The default sort order for the channel, by latest activity or by creation date.
|
|
29
|
+
*/
|
|
30
|
+
get defaultSortOrder(): IfPartial<IsPartial, SortOrderType | null>;
|
|
31
|
+
/**
|
|
32
|
+
* You cannot send a message directly to a forum or media channel, so this method throws an error.
|
|
33
|
+
* Use {@link GuildThreadChannel.send} instead, or the alias {@link GuildThreadOnlyChannel.sendToPost} instead, to send a message to the channel's posts.
|
|
34
|
+
*/
|
|
35
|
+
send(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Send a message to a post in the channel
|
|
38
|
+
* @remarks
|
|
39
|
+
* This is an alias for {@link GuildThreadChannel.send} that will fetch the channel, but if you already have the channel, you can use {@link GuildThreadChannel.send} instead.
|
|
40
|
+
*/
|
|
41
|
+
sendToPost(message: MessagePayload, postId: string): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=GuildThreadOnlyChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuildThreadOnlyChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/GuildThreadOnlyChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iCAAiC,EACjC,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,aAAa,EAEb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,8BAAsB,sBAAsB,CAC3C,IAAI,SAAS,WAAW,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,EAC5D,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC;IAClC,OAAO,EAAE,oBAAoB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAElD;;OAEG;IACH,IAAI,KAAK,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAG/C;IAED;;OAEG;IACH,IAAI,0BAA0B,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAGpE;IAED;;OAEG;IACH,IAAI,6BAA6B,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAGvE;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,SAAS,CAAC,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAG5D;IAED;;OAEG;IACH,IAAI,oBAAoB,IAAI,SAAS,CACpC,SAAS,EACT,iCAAiC,GAAG,IAAI,CACxC,CAGA;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC,CAGjE;IAED;;;OAGG;IACY,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMpC;;;;OAIG;IACG,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOxE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
|
|
2
|
+
import { BaseGuildChannel } from "./BaseGuildChannel.js";
|
|
3
|
+
export class GuildThreadOnlyChannel extends BaseGuildChannel {
|
|
4
|
+
/**
|
|
5
|
+
* The topic of the channel.
|
|
6
|
+
*/
|
|
7
|
+
get topic() {
|
|
8
|
+
if (!this.rawData)
|
|
9
|
+
return undefined;
|
|
10
|
+
return this.rawData.topic ?? null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The default auto archive duration of the channel.
|
|
14
|
+
*/
|
|
15
|
+
get defaultAutoArchiveDuration() {
|
|
16
|
+
if (!this.rawData)
|
|
17
|
+
return undefined;
|
|
18
|
+
return this.rawData.default_auto_archive_duration ?? null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The default thread rate limit per user for the channel.
|
|
22
|
+
*/
|
|
23
|
+
get defaultThreadRateLimitPerUser() {
|
|
24
|
+
if (!this.rawData)
|
|
25
|
+
return undefined;
|
|
26
|
+
return this.rawData.default_thread_rate_limit_per_user ?? null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The available tags to set on posts in the channel.
|
|
30
|
+
*/
|
|
31
|
+
get availableTags() {
|
|
32
|
+
if (!this.rawData)
|
|
33
|
+
return undefined;
|
|
34
|
+
return this.rawData.available_tags ?? [];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The default reaction emoji for the channel.
|
|
38
|
+
*/
|
|
39
|
+
get defaultReactionEmoji() {
|
|
40
|
+
if (!this.rawData)
|
|
41
|
+
return undefined;
|
|
42
|
+
return this.rawData.default_reaction_emoji;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The default sort order for the channel, by latest activity or by creation date.
|
|
46
|
+
*/
|
|
47
|
+
get defaultSortOrder() {
|
|
48
|
+
if (!this.rawData)
|
|
49
|
+
return undefined;
|
|
50
|
+
return this.rawData.default_sort_order;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* You cannot send a message directly to a forum or media channel, so this method throws an error.
|
|
54
|
+
* Use {@link GuildThreadChannel.send} instead, or the alias {@link GuildThreadOnlyChannel.sendToPost} instead, to send a message to the channel's posts.
|
|
55
|
+
*/
|
|
56
|
+
async send() {
|
|
57
|
+
throw new Error("You cannot send a message directly to a forum or media channel. Use GuildThreadChannel.send instead, or the alias GuildThreadOnlyChannel.sendToPost instead, to send a message to the channel's posts.");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Send a message to a post in the channel
|
|
61
|
+
* @remarks
|
|
62
|
+
* This is an alias for {@link GuildThreadChannel.send} that will fetch the channel, but if you already have the channel, you can use {@link GuildThreadChannel.send} instead.
|
|
63
|
+
*/
|
|
64
|
+
async sendToPost(message, postId) {
|
|
65
|
+
const channel = new GuildThreadChannel(this.client, postId);
|
|
66
|
+
await channel.send(message);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=GuildThreadOnlyChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuildThreadOnlyChannel.js","sourceRoot":"","sources":["../../../src/abstracts/GuildThreadOnlyChannel.ts"],"names":[],"mappings":"AAQA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;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,OAAuB,EAAE,MAAc;QACvD,MAAM,OAAO,GAAG,IAAI,kBAAkB,CACrC,IAAI,CAAC,MAAM,EACX,MAAM,CACN,CAAA;QACD,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;CACD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type APIButtonComponent, type APIButtonComponentWithSKUId, type APIButtonComponentWithURL, ButtonStyle, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseComponent } from "../abstracts/BaseComponent.js";
|
|
3
|
+
import type { ButtonInteraction } from "../internals/ButtonInteraction.js";
|
|
4
|
+
declare abstract class BaseButton extends BaseComponent {
|
|
5
|
+
type: ComponentType;
|
|
6
|
+
/**
|
|
7
|
+
* The label of the button
|
|
8
|
+
*/
|
|
9
|
+
abstract label: string;
|
|
10
|
+
/**
|
|
11
|
+
* The emoji of the button
|
|
12
|
+
*/
|
|
13
|
+
emoji?: {
|
|
14
|
+
name: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
animated?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The style of the button
|
|
20
|
+
*/
|
|
21
|
+
style: ButtonStyle;
|
|
22
|
+
/**
|
|
23
|
+
* The disabled state of the button
|
|
24
|
+
*/
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare abstract class Button extends BaseButton {
|
|
28
|
+
abstract run(interaction: ButtonInteraction): Promise<void>;
|
|
29
|
+
serialize: () => APIButtonComponent;
|
|
30
|
+
}
|
|
31
|
+
export declare abstract class LinkButton extends BaseButton {
|
|
32
|
+
customId: string;
|
|
33
|
+
/**
|
|
34
|
+
* The URL that the button links to
|
|
35
|
+
*/
|
|
36
|
+
abstract url: string;
|
|
37
|
+
style: ButtonStyle.Link;
|
|
38
|
+
serialize: () => APIButtonComponentWithURL;
|
|
39
|
+
}
|
|
40
|
+
export declare abstract class PremiumButton extends BaseButton {
|
|
41
|
+
style: ButtonStyle.Premium;
|
|
42
|
+
/**
|
|
43
|
+
* The SKU ID of the button
|
|
44
|
+
*/
|
|
45
|
+
abstract sku_id: string;
|
|
46
|
+
serialize: () => APIButtonComponentWithSKUId;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/classes/Button.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,WAAW,EACX,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,uBAAe,UAAW,SAAQ,aAAa;IAC9C,IAAI,gBAAuB;IAE3B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,QAAQ,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;IAED;;OAEG;IACH,KAAK,EAAE,WAAW,CAAsB;IAExC;;OAEG;IACH,QAAQ,UAAQ;CAChB;AAED,8BAAsB,MAAO,SAAQ,UAAU;IAC9C,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3D,SAAS,QAAO,kBAAkB,CAmBjC;CACD;AAED,8BAAsB,UAAW,SAAQ,UAAU;IAClD,QAAQ,SAAK;IACb;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,WAAW,CAAC,IAAI,CAAmB;IAE1C,SAAS,QAAO,yBAAyB,CASxC;CACD;AAED,8BAAsB,aAAc,SAAQ,UAAU;IACrD,KAAK,EAAE,WAAW,CAAC,OAAO,CAAsB;IAEhD;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEvB,SAAS,QAAO,2BAA2B,CAO1C;CACD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ButtonStyle, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseComponent } from "../abstracts/BaseComponent.js";
|
|
3
|
+
class BaseButton extends BaseComponent {
|
|
4
|
+
type = ComponentType.Button;
|
|
5
|
+
/**
|
|
6
|
+
* The emoji of the button
|
|
7
|
+
*/
|
|
8
|
+
emoji;
|
|
9
|
+
/**
|
|
10
|
+
* The style of the button
|
|
11
|
+
*/
|
|
12
|
+
style = ButtonStyle.Primary;
|
|
13
|
+
/**
|
|
14
|
+
* The disabled state of the button
|
|
15
|
+
*/
|
|
16
|
+
disabled = false;
|
|
17
|
+
}
|
|
18
|
+
export class Button extends BaseButton {
|
|
19
|
+
serialize = () => {
|
|
20
|
+
if (this.style === ButtonStyle.Link) {
|
|
21
|
+
throw new Error("Link buttons cannot be serialized. Are you using the right class?");
|
|
22
|
+
}
|
|
23
|
+
if (this.style === ButtonStyle.Premium) {
|
|
24
|
+
throw new Error("Premium buttons cannot be serialized. Are you using the right class?");
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
type: ComponentType.Button,
|
|
28
|
+
style: this.style,
|
|
29
|
+
label: this.label,
|
|
30
|
+
custom_id: this.customId,
|
|
31
|
+
disabled: this.disabled,
|
|
32
|
+
emoji: this.emoji
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export class LinkButton extends BaseButton {
|
|
37
|
+
customId = "";
|
|
38
|
+
style = ButtonStyle.Link;
|
|
39
|
+
serialize = () => {
|
|
40
|
+
return {
|
|
41
|
+
type: ComponentType.Button,
|
|
42
|
+
url: this.url,
|
|
43
|
+
style: this.style,
|
|
44
|
+
label: this.label,
|
|
45
|
+
disabled: this.disabled,
|
|
46
|
+
emoji: this.emoji
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export class PremiumButton extends BaseButton {
|
|
51
|
+
style = ButtonStyle.Premium;
|
|
52
|
+
serialize = () => {
|
|
53
|
+
return {
|
|
54
|
+
style: this.style,
|
|
55
|
+
type: ComponentType.Button,
|
|
56
|
+
disabled: this.disabled,
|
|
57
|
+
sku_id: this.sku_id
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/classes/Button.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,WAAW,EACX,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAe,UAAW,SAAQ,aAAa;IAC9C,IAAI,GAAG,aAAa,CAAC,MAAM,CAAA;IAO3B;;OAEG;IACH,KAAK,CAIJ;IAED;;OAEG;IACH,KAAK,GAAgB,WAAW,CAAC,OAAO,CAAA;IAExC;;OAEG;IACH,QAAQ,GAAG,KAAK,CAAA;CAChB;AAED,MAAM,OAAgB,MAAO,SAAQ,UAAU;IAG9C,SAAS,GAAG,GAAuB,EAAE;QACpC,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACd,mEAAmE,CACnE,CAAA;QACF,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CACd,sEAAsE,CACtE,CAAA;QACF,CAAC;QACD,OAAO;YACN,IAAI,EAAE,aAAa,CAAC,MAAM;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,CAAA;IACF,CAAC,CAAA;CACD;AAED,MAAM,OAAgB,UAAW,SAAQ,UAAU;IAClD,QAAQ,GAAG,EAAE,CAAA;IAKb,KAAK,GAAqB,WAAW,CAAC,IAAI,CAAA;IAE1C,SAAS,GAAG,GAA8B,EAAE;QAC3C,OAAO;YACN,IAAI,EAAE,aAAa,CAAC,MAAM;YAC1B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,CAAA;IACF,CAAC,CAAA;CACD;AAED,MAAM,OAAgB,aAAc,SAAQ,UAAU;IACrD,KAAK,GAAwB,WAAW,CAAC,OAAO,CAAA;IAOhD,SAAS,GAAG,GAAgC,EAAE;QAC7C,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,aAAa,CAAC,MAAM;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CAAA;IACF,CAAC,CAAA;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type APIChannelSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
import type { ChannelSelectMenuInteraction } from "../internals/ChannelSelectMenuInteraction.js";
|
|
4
|
+
export declare abstract class ChannelSelectMenu extends AnySelectMenu {
|
|
5
|
+
type: ComponentType.ChannelSelect;
|
|
6
|
+
channelTypes?: APIChannelSelectComponent["channel_types"];
|
|
7
|
+
defaultValues?: APIChannelSelectComponent["default_values"];
|
|
8
|
+
abstract run(interaction: ChannelSelectMenuInteraction): Promise<void>;
|
|
9
|
+
serializeOptions(): {
|
|
10
|
+
type: ComponentType.ChannelSelect;
|
|
11
|
+
default_values: import("discord-api-types/v10").APISelectMenuDefaultValue<import("discord-api-types/v10").SelectMenuDefaultValueType.Channel>[] | undefined;
|
|
12
|
+
channel_types: import("discord-api-types/v10").ChannelType[] | undefined;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ChannelSelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/classes/ChannelSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,yBAAyB,EAC9B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAA;AAEhG,8BAAsB,iBAAkB,SAAQ,aAAa;IAC5D,IAAI,EAAE,aAAa,CAAC,aAAa,CAA8B;IAC/D,YAAY,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAA;IACzD,aAAa,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;IAC3D,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC;IAEtE,gBAAgB;;;;;CAOhB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class ChannelSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.ChannelSelect;
|
|
5
|
+
channelTypes;
|
|
6
|
+
defaultValues;
|
|
7
|
+
serializeOptions() {
|
|
8
|
+
return {
|
|
9
|
+
type: this.type,
|
|
10
|
+
default_values: this.defaultValues,
|
|
11
|
+
channel_types: this.channelTypes
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ChannelSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/ChannelSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,iBAAkB,SAAQ,aAAa;IAC5D,IAAI,GAAgC,aAAa,CAAC,aAAa,CAAA;IAC/D,YAAY,CAA6C;IACzD,aAAa,CAA8C;IAG3D,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,aAAa;YAClC,aAAa,EAAE,IAAI,CAAC,YAAY;SAChC,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { RequestClient, type RequestClientOptions } from "@buape/carbon-request";
|
|
2
|
+
import { AutoRouter, type IRequestStrict } from "itty-router";
|
|
3
|
+
import type { BaseCommand } from "../abstracts/BaseCommand.js";
|
|
4
|
+
import { CommandHandler } from "../internals/CommandHandler.js";
|
|
5
|
+
import { ComponentHandler } from "../internals/ComponentHandler.js";
|
|
6
|
+
import { ModalHandler } from "../internals/ModalHandler.js";
|
|
7
|
+
import { Guild } from "../structures/Guild.js";
|
|
8
|
+
import { GuildMember } from "../structures/GuildMember.js";
|
|
9
|
+
import { Role } from "../structures/Role.js";
|
|
10
|
+
import { User } from "../structures/User.js";
|
|
11
|
+
/**
|
|
12
|
+
* The mode that the client is running in.
|
|
13
|
+
* Different platforms have different requirements for how processes are handled.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum ClientMode {
|
|
16
|
+
NodeJS = "node",
|
|
17
|
+
CloudflareWorkers = "cloudflare",
|
|
18
|
+
Bun = "bun",
|
|
19
|
+
Vercel = "vercel",
|
|
20
|
+
Web = "web"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The options used for initializing the client
|
|
24
|
+
*/
|
|
25
|
+
export type ClientOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* If you want to have the root route for the interaction handler redirect to a different URL, you can set this.
|
|
28
|
+
*/
|
|
29
|
+
redirectUrl?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The client ID of the bot
|
|
32
|
+
*/
|
|
33
|
+
clientId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The public key of the bot, used for interaction verification
|
|
36
|
+
*/
|
|
37
|
+
publicKey: string;
|
|
38
|
+
/**
|
|
39
|
+
* The token of the bot
|
|
40
|
+
*/
|
|
41
|
+
token: string;
|
|
42
|
+
/**
|
|
43
|
+
* The mode of the client, generally where you are hosting the bot. If you have a different mode for your local development, make sure to set it to the local one.
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { Client, ClientMode } from "@buape/carbon"
|
|
47
|
+
*
|
|
48
|
+
* const client = new Client({
|
|
49
|
+
* clientId: "12345678901234567890",
|
|
50
|
+
* publicKey: "c1a2f941ae8ce6d776f7704d0bb3d46b863e21fda491cdb2bdba6b8bc5fe7269",
|
|
51
|
+
* token: "MTA4NjEwNTYxMDUxMDE1NTg1Nw.GNt-U8.OSHy-g-5FlfESnu3Z9MEEMJLHiRthXajiXNwiE",
|
|
52
|
+
* mode: process.env.NODE_ENV === "development" ? ClientMode.NodeJS : ClientMode.CloudflareWorkers
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
mode: ClientMode;
|
|
57
|
+
/**
|
|
58
|
+
* The route to use for interactions on your server.
|
|
59
|
+
* @default "/interaction"
|
|
60
|
+
*/
|
|
61
|
+
interactionRoute?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The options used to initialize the request client, if you want to customize it.
|
|
64
|
+
*/
|
|
65
|
+
requestOptions?: RequestClientOptions;
|
|
66
|
+
/**
|
|
67
|
+
* The port to run the server on, if you are using {@link ClientMode.Bun} mode.
|
|
68
|
+
*/
|
|
69
|
+
port?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the commands should be deployed to Discord automatically.
|
|
72
|
+
*/
|
|
73
|
+
autoDeploy?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether components and modals should be registered automatically.
|
|
76
|
+
* If you don't want to do this (e.g. you are changing them at runtime), you can manually call {@link ComponentHandler#registerComponent} and {@link ModalHandler#registerModal} on the client.
|
|
77
|
+
*/
|
|
78
|
+
autoRegister?: boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The main client used to interact with Discord
|
|
82
|
+
*/
|
|
83
|
+
export declare class Client {
|
|
84
|
+
/**
|
|
85
|
+
* The options used to initialize the client
|
|
86
|
+
*/
|
|
87
|
+
options: ClientOptions;
|
|
88
|
+
/**
|
|
89
|
+
* The commands that the client has registered
|
|
90
|
+
*/
|
|
91
|
+
commands: BaseCommand[];
|
|
92
|
+
/**
|
|
93
|
+
* The router used to handle requests
|
|
94
|
+
*/
|
|
95
|
+
router: ReturnType<typeof AutoRouter<IRequestStrict>>;
|
|
96
|
+
/**
|
|
97
|
+
* The rest client used to interact with the Discord API
|
|
98
|
+
*/
|
|
99
|
+
rest: RequestClient;
|
|
100
|
+
/**
|
|
101
|
+
* The handler for the component interactions sent from Discord
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
componentHandler: ComponentHandler;
|
|
105
|
+
/**
|
|
106
|
+
* The handler for the modal interactions sent from Discord
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
commandHandler: CommandHandler;
|
|
110
|
+
/**
|
|
111
|
+
* The handler for the modal interactions sent from Discord
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
modalHandler: ModalHandler;
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new client
|
|
117
|
+
* @param options The options used to initialize the client
|
|
118
|
+
* @param commands The commands that the client has registered
|
|
119
|
+
*/
|
|
120
|
+
constructor(options: ClientOptions, commands: BaseCommand[]);
|
|
121
|
+
/**
|
|
122
|
+
* Deploy the commands registered to Discord.
|
|
123
|
+
* This is automatically called when running in NodeJS mode.
|
|
124
|
+
*/
|
|
125
|
+
deployCommands(): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Setup the routes for the client
|
|
128
|
+
*/
|
|
129
|
+
private setupRoutes;
|
|
130
|
+
/**
|
|
131
|
+
* If you want use a custom handler for HTTP requests instead of Carbon's router, you can use this method.
|
|
132
|
+
* @param req The request to handle
|
|
133
|
+
* @param ctx Cloudflare Workers only. The execution context of the request, provided in the fetch handler from CF.
|
|
134
|
+
* @returns A response to send back to the client.
|
|
135
|
+
*/
|
|
136
|
+
handle(req: Request, ctx?: ExecutionContext): Promise<Response>;
|
|
137
|
+
/**
|
|
138
|
+
* Validate the interaction request
|
|
139
|
+
* @param req The request to validate
|
|
140
|
+
*/
|
|
141
|
+
private validateInteraction;
|
|
142
|
+
/**
|
|
143
|
+
* Fetch a user from the Discord API
|
|
144
|
+
* @param id The ID of the user to fetch
|
|
145
|
+
* @returns The user data
|
|
146
|
+
*/
|
|
147
|
+
fetchUser(id: string): Promise<User<false>>;
|
|
148
|
+
/**
|
|
149
|
+
* Fetch a guild from the Discord API
|
|
150
|
+
* @param id The ID of the guild to fetch
|
|
151
|
+
* @returns The guild data
|
|
152
|
+
*/
|
|
153
|
+
fetchGuild(id: string): Promise<Guild<false>>;
|
|
154
|
+
/**
|
|
155
|
+
* Fetch a channel from the Discord API
|
|
156
|
+
* @param id The ID of the channel to fetch
|
|
157
|
+
* @returns The channel data
|
|
158
|
+
*/
|
|
159
|
+
fetchChannel(id: string): Promise<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>;
|
|
160
|
+
/**
|
|
161
|
+
* Fetch a role from the Discord API
|
|
162
|
+
* @param id The ID of the role to fetch
|
|
163
|
+
* @returns The role data
|
|
164
|
+
*/
|
|
165
|
+
fetchRole(guildId: string, id: string): Promise<Role<false>>;
|
|
166
|
+
/**
|
|
167
|
+
* Fetch a member from the Discord API
|
|
168
|
+
* @param guildId The ID of the guild the member is in
|
|
169
|
+
* @param id The ID of the member to fetch
|
|
170
|
+
* @returns The member data
|
|
171
|
+
*/
|
|
172
|
+
fetchMember(guildId: string, id: string): Promise<GuildMember<false, true>>;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* @hidden
|
|
176
|
+
*/
|
|
177
|
+
export interface ExecutionContext {
|
|
178
|
+
waitUntil(promise: Promise<any>): void;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=Client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../src/classes/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAYhF,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAqB,MAAM,aAAa,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,KAAK,E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