@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,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of metadata that you can check for
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ApplicationRoleConnectionMetadataType {
|
|
5
|
+
/**
|
|
6
|
+
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
|
|
7
|
+
*/
|
|
8
|
+
IntegerLessThanOrEqual = 1,
|
|
9
|
+
/**
|
|
10
|
+
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
|
|
11
|
+
*/
|
|
12
|
+
IntegerGreaterThanOrEqual = 2,
|
|
13
|
+
/**
|
|
14
|
+
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
|
|
15
|
+
*/
|
|
16
|
+
IntegerEqual = 3,
|
|
17
|
+
/**
|
|
18
|
+
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
|
|
19
|
+
*/
|
|
20
|
+
IntegerNotEqual = 4,
|
|
21
|
+
/**
|
|
22
|
+
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
|
|
23
|
+
*/
|
|
24
|
+
DatetimeLessThanOrEqual = 5,
|
|
25
|
+
/**
|
|
26
|
+
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
|
|
27
|
+
*/
|
|
28
|
+
DatetimeGreaterThanOrEqual = 6,
|
|
29
|
+
/**
|
|
30
|
+
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
|
|
31
|
+
*/
|
|
32
|
+
BooleanEqual = 7,
|
|
33
|
+
/**
|
|
34
|
+
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
|
|
35
|
+
*/
|
|
36
|
+
BooleanNotEqual = 8
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The options for the linked roles package
|
|
40
|
+
*/
|
|
41
|
+
export type LinkedRolesOptions = {
|
|
42
|
+
/**
|
|
43
|
+
* The client secret for the bot
|
|
44
|
+
*/
|
|
45
|
+
clientSecret: string;
|
|
46
|
+
/**
|
|
47
|
+
* The base URL of where you are hosting your bot.
|
|
48
|
+
* This is used for redirect URLs to and from Discord's OAuth2 flow.
|
|
49
|
+
*/
|
|
50
|
+
baseUrl: string;
|
|
51
|
+
/**
|
|
52
|
+
* The metadata that you want to check for, and that should show to the end-user on Discord.
|
|
53
|
+
*/
|
|
54
|
+
metadata: LinkedRoleCriteria[];
|
|
55
|
+
/**
|
|
56
|
+
* The functions that you want to use to check the metadata.
|
|
57
|
+
* @remarks
|
|
58
|
+
* If you are checking a boolean, you should return `true` or `false`.
|
|
59
|
+
* If you are checking an integer, you should return a number that is safe to use as an integer.
|
|
60
|
+
* If you are checking a datetime, you should return a Date.now() timestamp.
|
|
61
|
+
*/
|
|
62
|
+
metadataCheckers: {
|
|
63
|
+
[name: string]: (userId: string) => Promise<number | boolean>;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The metadata that you want to check for, and that should show to the end-user on Discord.
|
|
68
|
+
* @remarks You can only have 5 metadata per application, and they apply across all guilds your app is in.
|
|
69
|
+
*/
|
|
70
|
+
export type LinkedRoleCriteria = {
|
|
71
|
+
/**
|
|
72
|
+
* The key of the metadata. This is only used on the code side, and is not seen by the end user.
|
|
73
|
+
*/
|
|
74
|
+
key: string;
|
|
75
|
+
/**
|
|
76
|
+
* The type of metadata that you want to check for.
|
|
77
|
+
*/
|
|
78
|
+
type: ApplicationRoleConnectionMetadataType;
|
|
79
|
+
/**
|
|
80
|
+
* The name of the metadata. This is what the end user will see.
|
|
81
|
+
*/
|
|
82
|
+
name: string;
|
|
83
|
+
/**
|
|
84
|
+
* A description of the metadata.
|
|
85
|
+
*/
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/linked-roles/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qCAAqC;IAChD;;OAEG;IACH,sBAAsB,IAAI;IAC1B;;OAEG;IACH,yBAAyB,IAAI;IAC7B;;OAEG;IACH,YAAY,IAAI;IAChB;;OAEG;IACH,eAAe,IAAI;IACnB;;OAEG;IACH,uBAAuB,IAAI;IAC3B;;OAEG;IACH,0BAA0B,IAAI;IAC9B;;OAEG;IACH,YAAY,IAAI;IAChB;;OAEG;IACH,eAAe,IAAI;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,EAAE,kBAAkB,EAAE,CAAA;IAC9B;;;;;;OAMG;IACH,gBAAgB,EAAE;QACjB,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,CAAA;KAC7D,CAAA;CACD,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,IAAI,EAAE,qCAAqC,CAAA;IAC3C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of metadata that you can check for
|
|
3
|
+
*/
|
|
4
|
+
export var ApplicationRoleConnectionMetadataType;
|
|
5
|
+
(function (ApplicationRoleConnectionMetadataType) {
|
|
6
|
+
/**
|
|
7
|
+
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
|
|
8
|
+
*/
|
|
9
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["IntegerLessThanOrEqual"] = 1] = "IntegerLessThanOrEqual";
|
|
10
|
+
/**
|
|
11
|
+
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
|
|
12
|
+
*/
|
|
13
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["IntegerGreaterThanOrEqual"] = 2] = "IntegerGreaterThanOrEqual";
|
|
14
|
+
/**
|
|
15
|
+
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
|
|
16
|
+
*/
|
|
17
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["IntegerEqual"] = 3] = "IntegerEqual";
|
|
18
|
+
/**
|
|
19
|
+
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
|
|
20
|
+
*/
|
|
21
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["IntegerNotEqual"] = 4] = "IntegerNotEqual";
|
|
22
|
+
/**
|
|
23
|
+
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
|
|
24
|
+
*/
|
|
25
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["DatetimeLessThanOrEqual"] = 5] = "DatetimeLessThanOrEqual";
|
|
26
|
+
/**
|
|
27
|
+
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
|
|
28
|
+
*/
|
|
29
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["DatetimeGreaterThanOrEqual"] = 6] = "DatetimeGreaterThanOrEqual";
|
|
30
|
+
/**
|
|
31
|
+
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
|
|
32
|
+
*/
|
|
33
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["BooleanEqual"] = 7] = "BooleanEqual";
|
|
34
|
+
/**
|
|
35
|
+
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
|
|
36
|
+
*/
|
|
37
|
+
ApplicationRoleConnectionMetadataType[ApplicationRoleConnectionMetadataType["BooleanNotEqual"] = 8] = "BooleanNotEqual";
|
|
38
|
+
})(ApplicationRoleConnectionMetadataType || (ApplicationRoleConnectionMetadataType = {}));
|
|
39
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/plugins/linked-roles/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,qCAiCX;AAjCD,WAAY,qCAAqC;IAChD;;OAEG;IACH,qIAA0B,CAAA;IAC1B;;OAEG;IACH,2IAA6B,CAAA;IAC7B;;OAEG;IACH,iHAAgB,CAAA;IAChB;;OAEG;IACH,uHAAmB,CAAA;IACnB;;OAEG;IACH,uIAA2B,CAAA;IAC3B;;OAEG;IACH,6IAA8B,CAAA;IAC9B;;OAEG;IACH,iHAAgB,CAAA;IAChB;;OAEG;IACH,uHAAmB,CAAA;AACpB,CAAC,EAjCW,qCAAqC,KAArC,qCAAqC,QAiChD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type APIDMChannel, type ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
import type { MessagePayload } from "../types.js";
|
|
4
|
+
import { type IfPartial } from "../utils.js";
|
|
5
|
+
/**
|
|
6
|
+
* Represents a DM between two users.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DmChannel<IsPartial extends boolean = false> extends BaseChannel<ChannelType.DM, IsPartial> {
|
|
9
|
+
rawData: APIDMChannel | null;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the channel. This is always null for DM channels.
|
|
12
|
+
*/
|
|
13
|
+
get name(): IfPartial<IsPartial, null>;
|
|
14
|
+
/**
|
|
15
|
+
* Send a message to the channel
|
|
16
|
+
*/
|
|
17
|
+
send(message: MessagePayload): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=DmChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DmChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/DmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,aAAa,CAAA;AAE9D;;GAEG;AACH,qBAAa,SAAS,CAAC,SAAS,SAAS,OAAO,GAAG,KAAK,CAAE,SAAQ,WAAW,CAC5E,WAAW,CAAC,EAAE,EACd,SAAS,CACT;IACQ,OAAO,EAAE,YAAY,GAAG,IAAI,CAAA;IAEpC;;OAEG;IACH,IAAI,IAAI,IAAI,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAGrC;IAED;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc;CAKlC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
import { serializePayload } from "../utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a DM between two users.
|
|
6
|
+
*/
|
|
7
|
+
export class DmChannel extends BaseChannel {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the channel. This is always null for DM channels.
|
|
10
|
+
*/
|
|
11
|
+
get name() {
|
|
12
|
+
if (!this.rawData)
|
|
13
|
+
return undefined;
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Send a message to the channel
|
|
18
|
+
*/
|
|
19
|
+
async send(message) {
|
|
20
|
+
this.client.rest.post(Routes.channelMessages(this.id), {
|
|
21
|
+
body: serializePayload(message)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=DmChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DmChannel.js","sourceRoot":"","sources":["../../../src/structures/DmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,EAAkB,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9D;;GAEG;AACH,MAAM,OAAO,SAA6C,SAAQ,WAGjE;IAGA;;OAEG;IACH,IAAI,IAAI;QACP,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAA;IACZ,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;CACD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type APIGroupDMChannel, type ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
import type { IfPartial } from "../utils.js";
|
|
4
|
+
import { Message } from "./Message.js";
|
|
5
|
+
import { User } from "./User.js";
|
|
6
|
+
/**
|
|
7
|
+
* Represents a group DM channel.
|
|
8
|
+
*/
|
|
9
|
+
export declare class GroupDmChannel<IsPartial extends boolean = false> extends BaseChannel<ChannelType.GroupDM, IsPartial> {
|
|
10
|
+
rawData: APIGroupDMChannel | null;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the channel.
|
|
13
|
+
*/
|
|
14
|
+
get name(): IfPartial<IsPartial, string | null>;
|
|
15
|
+
/**
|
|
16
|
+
* The recipients of the channel.
|
|
17
|
+
*/
|
|
18
|
+
get recipients(): IfPartial<IsPartial, User<boolean>[]>;
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the application that created the channel, if it was created by a bot.
|
|
21
|
+
*/
|
|
22
|
+
get applicationId(): IfPartial<IsPartial, string | null>;
|
|
23
|
+
/**
|
|
24
|
+
* The icon hash of the channel.
|
|
25
|
+
*/
|
|
26
|
+
get icon(): IfPartial<IsPartial, string | null>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the URL of the channel's icon.
|
|
29
|
+
*/
|
|
30
|
+
get iconUrl(): IfPartial<IsPartial, string | null>;
|
|
31
|
+
/**
|
|
32
|
+
* The ID of the user who created the channel.
|
|
33
|
+
*/
|
|
34
|
+
get ownerId(): IfPartial<IsPartial, string | null>;
|
|
35
|
+
/**
|
|
36
|
+
* The ID of the last message sent in the channel.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* 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.
|
|
40
|
+
*/
|
|
41
|
+
get lastMessageId(): IfPartial<IsPartial, string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the channel is managed by an Oauth2 application.
|
|
44
|
+
*/
|
|
45
|
+
get managed(): IfPartial<IsPartial, boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* Get the owner of the channel.
|
|
48
|
+
*/
|
|
49
|
+
get owner(): User<true>;
|
|
50
|
+
/**
|
|
51
|
+
* The last message sent in the channel.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* 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.
|
|
55
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
get lastMessage(): Message<true> | null;
|
|
59
|
+
/**
|
|
60
|
+
* Set the name of the channel
|
|
61
|
+
* @param name The new name of the channel
|
|
62
|
+
*/
|
|
63
|
+
setName(name: string): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=GroupDmChannel.d.ts.map
|
|
@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ACH,IAAI,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAG3C;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,CAGtB;IAED;;;;;;;OAOG;IACH,IAAI,WAAW,yBAMd;IAED;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM;CA4B1B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
import { Message } from "./Message.js";
|
|
4
|
+
import { User } from "./User.js";
|
|
5
|
+
/**
|
|
6
|
+
* Represents a group DM channel.
|
|
7
|
+
*/
|
|
8
|
+
export class GroupDmChannel extends BaseChannel {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the channel.
|
|
11
|
+
*/
|
|
12
|
+
get name() {
|
|
13
|
+
if (!this.rawData)
|
|
14
|
+
return undefined;
|
|
15
|
+
return this.rawData.name;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The recipients of the channel.
|
|
19
|
+
*/
|
|
20
|
+
get recipients() {
|
|
21
|
+
if (!this.rawData)
|
|
22
|
+
return undefined;
|
|
23
|
+
const recipients = this.rawData.recipients ?? [];
|
|
24
|
+
return recipients.map((u) => new User(this.client, u));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The ID of the application that created the channel, if it was created by a bot.
|
|
28
|
+
*/
|
|
29
|
+
get applicationId() {
|
|
30
|
+
if (!this.rawData)
|
|
31
|
+
return undefined;
|
|
32
|
+
return this.rawData.application_id ?? null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The icon hash of the channel.
|
|
36
|
+
*/
|
|
37
|
+
get icon() {
|
|
38
|
+
if (!this.rawData)
|
|
39
|
+
return undefined;
|
|
40
|
+
return this.rawData.icon ?? null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL of the channel's icon.
|
|
44
|
+
*/
|
|
45
|
+
get iconUrl() {
|
|
46
|
+
if (!this.rawData)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (!this.icon)
|
|
49
|
+
return null;
|
|
50
|
+
return `https://cdn.discordapp.com/channel-icons/${this.id}/${this.icon}.png`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The ID of the user who created the channel.
|
|
54
|
+
*/
|
|
55
|
+
get ownerId() {
|
|
56
|
+
if (!this.rawData)
|
|
57
|
+
return undefined;
|
|
58
|
+
return this.rawData.owner_id ?? null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The ID of the last message sent in the channel.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* 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.
|
|
65
|
+
*/
|
|
66
|
+
get lastMessageId() {
|
|
67
|
+
if (!this.rawData)
|
|
68
|
+
return undefined;
|
|
69
|
+
return this.rawData.last_message_id ?? null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether the channel is managed by an Oauth2 application.
|
|
73
|
+
*/
|
|
74
|
+
get managed() {
|
|
75
|
+
if (!this.rawData)
|
|
76
|
+
return undefined;
|
|
77
|
+
return this.rawData.managed ?? false;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the owner of the channel.
|
|
81
|
+
*/
|
|
82
|
+
get owner() {
|
|
83
|
+
if (!this.ownerId)
|
|
84
|
+
throw new Error("Cannot get owner without owner ID");
|
|
85
|
+
return new User(this.client, this.ownerId);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The last message sent in the channel.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* 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.
|
|
92
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
95
|
+
get lastMessage() {
|
|
96
|
+
if (!this.lastMessageId)
|
|
97
|
+
return null;
|
|
98
|
+
return new Message(this.client, {
|
|
99
|
+
id: this.lastMessageId,
|
|
100
|
+
channelId: this.id
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Set the name of the channel
|
|
105
|
+
* @param name The new name of the channel
|
|
106
|
+
*/
|
|
107
|
+
async setName(name) {
|
|
108
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
109
|
+
body: {
|
|
110
|
+
name
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
this.setField("name", name);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=GroupDmChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupDmChannel.js","sourceRoot":"","sources":["../../../src/structures/GroupDmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;GAEG;AACH,MAAM,OAAO,cAEX,SAAQ,WAA2C;IAGpD;;OAEG;IACH,IAAI,IAAI;QACP,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IACzB,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACb,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAA;QAChD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAA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IAAI,IAAI,CAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACjD,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,WAAW;QACd,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,OAAO,IAAI,CAAA;QACpC,OAAO,IAAI,OAAO,CAAO,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,IAAI,CAAC,aAAa;YACtB,SAAS,EAAE,IAAI,CAAC,EAAE;SAClB,CAAC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,IAAY;QACzB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACrD,IAAI,EAAE;gBACL,IAAI;aACJ;SACD,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC5B,CAAC;CAqBD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type APIGuild, type RESTPostAPIGuildRoleJSONBody } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import type { Client } from "../classes/Client.js";
|
|
4
|
+
import type { IfPartial } from "../utils.js";
|
|
5
|
+
import { GuildMember } from "./GuildMember.js";
|
|
6
|
+
import { Role } from "./Role.js";
|
|
7
|
+
export declare class Guild<IsPartial extends boolean = false> extends Base {
|
|
8
|
+
constructor(client: Client, rawDataOrId: IsPartial extends true ? string : APIGuild);
|
|
9
|
+
private rawData;
|
|
10
|
+
private setData;
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the guild
|
|
13
|
+
*/
|
|
14
|
+
readonly id: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the guild is a partial guild (meaning it does not have all the data).
|
|
17
|
+
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
18
|
+
*/
|
|
19
|
+
get partial(): IfPartial<IsPartial, false, true>;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the guild.
|
|
22
|
+
*/
|
|
23
|
+
get name(): IfPartial<IsPartial, string>;
|
|
24
|
+
/**
|
|
25
|
+
* The description of the guild.
|
|
26
|
+
*/
|
|
27
|
+
get description(): IfPartial<IsPartial, string | null>;
|
|
28
|
+
/**
|
|
29
|
+
* The icon hash of the guild.
|
|
30
|
+
* You can use {@link Guild.iconUrl} to get the URL of the icon.
|
|
31
|
+
*/
|
|
32
|
+
get icon(): IfPartial<IsPartial, string | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the URL of the guild's icon
|
|
35
|
+
*/
|
|
36
|
+
get iconUrl(): IfPartial<IsPartial, string | null>;
|
|
37
|
+
/**
|
|
38
|
+
* The splash hash of the guild.
|
|
39
|
+
* You can use {@link Guild.splashUrl} to get the URL of the splash.
|
|
40
|
+
*/
|
|
41
|
+
get splash(): IfPartial<IsPartial, string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL of the guild's splash
|
|
44
|
+
*/
|
|
45
|
+
get splashUrl(): IfPartial<IsPartial, string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the owner of the guild.
|
|
48
|
+
*/
|
|
49
|
+
get ownerId(): IfPartial<IsPartial, string>;
|
|
50
|
+
/**
|
|
51
|
+
* Get all roles in the guild
|
|
52
|
+
*/
|
|
53
|
+
get roles(): IfPartial<IsPartial, Role[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch updated data for this guild.
|
|
56
|
+
* If the guild is partial, this will fetch all the data for the guild and populate the fields.
|
|
57
|
+
* If the guild is not partial, all fields will be updated with new values from Discord.
|
|
58
|
+
*/
|
|
59
|
+
fetch(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Leave the guild
|
|
62
|
+
*/
|
|
63
|
+
leave(): Promise<unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a role in the guild
|
|
66
|
+
*/
|
|
67
|
+
createRole(data: RESTPostAPIGuildRoleJSONBody): Promise<Role<false>>;
|
|
68
|
+
/**
|
|
69
|
+
* Get a member in the guild by ID
|
|
70
|
+
*/
|
|
71
|
+
fetchMember(memberId: string): Promise<GuildMember<false, IsPartial>>;
|
|
72
|
+
/**
|
|
73
|
+
* Fetch a channel from the guild by ID
|
|
74
|
+
*/
|
|
75
|
+
fetchChannel(channelId: string): Promise<import("./DmChannel.js").DmChannel<false> | import("./GroupDmChannel.js").GroupDmChannel<false> | import("./GuildTextChannel.js").GuildTextChannel<false> | import("./GuildStageOrVoiceChannel.js").GuildVoiceChannel<false> | import("./GuildCategoryChannel.js").GuildCategoryChannel<false> | import("./GuildAnnouncementChannel.js").GuildAnnouncementChannel<false> | import("./GuildThreadChannel.js").GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType, false> | import("./GuildStageOrVoiceChannel.js").GuildStageChannel<false> | import("./GuildForumChannel.js").GuildForumChannel<false> | import("./GuildMediaChannel.js").GuildMediaChannel | null>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=Guild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Guild.d.ts","sourceRoot":"","sources":["../../../src/structures/Guild.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,QAAQ,EAGb,KAAK,4BAA4B,EAEjC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,qBAAa,KAAK,CAAC,SAAS,SAAS,OAAO,GAAG,KAAK,CAAE,SAAQ,IAAI;gBAEhE,MAAM,EAAE,MAAM,EACd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
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import { channelFactory } from "../factories/channelFactory.js";
|
|
4
|
+
import { GuildMember } from "./GuildMember.js";
|
|
5
|
+
import { Role } from "./Role.js";
|
|
6
|
+
export class Guild extends Base {
|
|
7
|
+
constructor(client, rawDataOrId) {
|
|
8
|
+
super(client);
|
|
9
|
+
if (typeof rawDataOrId === "string") {
|
|
10
|
+
this.id = rawDataOrId;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.rawData = rawDataOrId;
|
|
14
|
+
this.id = rawDataOrId.id;
|
|
15
|
+
this.setData(rawDataOrId);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
rawData = null;
|
|
19
|
+
setData(data) {
|
|
20
|
+
if (!data)
|
|
21
|
+
throw new Error("Cannot set data without having data... smh");
|
|
22
|
+
this.rawData = data;
|
|
23
|
+
}
|
|
24
|
+
// private setField(key: keyof APIGuild, value: unknown) {
|
|
25
|
+
// if (!this.rawData)
|
|
26
|
+
// throw new Error("Cannot set field without having data... smh")
|
|
27
|
+
// Reflect.set(this.rawData, key, value)
|
|
28
|
+
// }
|
|
29
|
+
/**
|
|
30
|
+
* The ID of the guild
|
|
31
|
+
*/
|
|
32
|
+
id;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the guild is a partial guild (meaning it does not have all the data).
|
|
35
|
+
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
36
|
+
*/
|
|
37
|
+
get partial() {
|
|
38
|
+
return (this.rawData === null);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The name of the guild.
|
|
42
|
+
*/
|
|
43
|
+
get name() {
|
|
44
|
+
if (!this.rawData)
|
|
45
|
+
return undefined;
|
|
46
|
+
return this.rawData.name;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The description of the guild.
|
|
50
|
+
*/
|
|
51
|
+
get description() {
|
|
52
|
+
if (!this.rawData)
|
|
53
|
+
return undefined;
|
|
54
|
+
return this.rawData.description;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The icon hash of the guild.
|
|
58
|
+
* You can use {@link Guild.iconUrl} to get the URL of the icon.
|
|
59
|
+
*/
|
|
60
|
+
get icon() {
|
|
61
|
+
if (!this.rawData)
|
|
62
|
+
return undefined;
|
|
63
|
+
return this.rawData.icon;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get the URL of the guild's icon
|
|
67
|
+
*/
|
|
68
|
+
get iconUrl() {
|
|
69
|
+
if (!this.rawData)
|
|
70
|
+
return undefined;
|
|
71
|
+
if (!this.icon)
|
|
72
|
+
return null;
|
|
73
|
+
return `https://cdn.discordapp.com/icons/${this.id}/${this.icon}.png`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The splash hash of the guild.
|
|
77
|
+
* You can use {@link Guild.splashUrl} to get the URL of the splash.
|
|
78
|
+
*/
|
|
79
|
+
get splash() {
|
|
80
|
+
if (!this.rawData)
|
|
81
|
+
return undefined;
|
|
82
|
+
return this.rawData.splash;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get the URL of the guild's splash
|
|
86
|
+
*/
|
|
87
|
+
get splashUrl() {
|
|
88
|
+
if (!this.rawData)
|
|
89
|
+
return undefined;
|
|
90
|
+
if (!this.splash)
|
|
91
|
+
return null;
|
|
92
|
+
return `https://cdn.discordapp.com/splashes/${this.id}/${this.splash}.png`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The ID of the owner of the guild.
|
|
96
|
+
*/
|
|
97
|
+
get ownerId() {
|
|
98
|
+
if (!this.rawData)
|
|
99
|
+
return undefined;
|
|
100
|
+
return this.rawData.owner_id;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get all roles in the guild
|
|
104
|
+
*/
|
|
105
|
+
get roles() {
|
|
106
|
+
if (!this.rawData)
|
|
107
|
+
return undefined;
|
|
108
|
+
const roles = this.rawData?.roles;
|
|
109
|
+
if (!roles)
|
|
110
|
+
throw new Error("Cannot get roles without having data... smh");
|
|
111
|
+
return roles.map((role) => new Role(this.client, role));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Fetch updated data for this guild.
|
|
115
|
+
* If the guild is partial, this will fetch all the data for the guild and populate the fields.
|
|
116
|
+
* If the guild is not partial, all fields will be updated with new values from Discord.
|
|
117
|
+
*/
|
|
118
|
+
async fetch() {
|
|
119
|
+
const newData = (await this.client.rest.get(Routes.guild(this.id)));
|
|
120
|
+
if (!newData)
|
|
121
|
+
throw new Error(`Guild ${this.id}not found`);
|
|
122
|
+
this.setData(newData);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Leave the guild
|
|
126
|
+
*/
|
|
127
|
+
async leave() {
|
|
128
|
+
return await this.client.rest.delete(Routes.guild(this.id));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Create a role in the guild
|
|
132
|
+
*/
|
|
133
|
+
async createRole(data) {
|
|
134
|
+
const role = (await this.client.rest.post(Routes.guildRoles(this.id), {
|
|
135
|
+
body: {
|
|
136
|
+
...data
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
return new Role(this.client, role);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get a member in the guild by ID
|
|
143
|
+
*/
|
|
144
|
+
async fetchMember(memberId) {
|
|
145
|
+
const member = (await this.client.rest.get(Routes.guildMember(this.id, memberId)));
|
|
146
|
+
return new GuildMember(this.client, member, this);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Fetch a channel from the guild by ID
|
|
150
|
+
*/
|
|
151
|
+
async fetchChannel(channelId) {
|
|
152
|
+
const channel = (await this.client.rest.get(Routes.channel(channelId)));
|
|
153
|
+
return channelFactory(this.client, channel);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=Guild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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AAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CACrC,CAAmB,CAAA;QACpB,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,SAAiB;QACnC,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAC1C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CACzB,CAAe,CAAA;QAChB,OAAO,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;CACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type APIGuildTextChannel, type ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseGuildTextChannel } from "../abstracts/BaseGuildTextChannel.js";
|
|
3
|
+
import type { GuildTextChannel } from "./GuildTextChannel.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a guild announcement channel.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GuildAnnouncementChannel<IsPartial extends boolean = false> extends BaseGuildTextChannel<ChannelType.GuildAnnouncement, IsPartial> {
|
|
8
|
+
rawData: APIGuildTextChannel<ChannelType.GuildAnnouncement> | null;
|
|
9
|
+
follow(targetChannel: GuildTextChannel | string): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=GuildAnnouncementChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuildAnnouncementChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D;;GAEG;AACH,qBAAa,wBAAwB,CACpC,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC/D,OAAO,EAAE,mBAAmB,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;IAEpE,MAAM,CAAC,aAAa,EAAE,gBAAgB,GAAG,MAAM;CAQrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseGuildTextChannel } from "../abstracts/BaseGuildTextChannel.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a guild announcement channel.
|
|
5
|
+
*/
|
|
6
|
+
export class GuildAnnouncementChannel extends BaseGuildTextChannel {
|
|
7
|
+
async follow(targetChannel) {
|
|
8
|
+
await this.client.rest.put(Routes.channelFollowers(this.id), {
|
|
9
|
+
body: {
|
|
10
|
+
webhook_channel_id: typeof targetChannel === "string" ? targetChannel : targetChannel.id
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=GuildAnnouncementChannel.js.map
|