@jubbio/core 1.3.1 → 1.3.2

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.
Files changed (121) hide show
  1. package/dist/cjs/Client.d.ts +157 -0
  2. package/dist/cjs/Client.js +640 -0
  3. package/dist/cjs/builders/ActionRowBuilder.d.ts +53 -0
  4. package/dist/cjs/builders/ActionRowBuilder.js +68 -0
  5. package/dist/cjs/builders/ButtonBuilder.d.ts +77 -0
  6. package/dist/cjs/builders/ButtonBuilder.js +96 -0
  7. package/dist/cjs/builders/EmbedBuilder.d.ts +157 -0
  8. package/dist/cjs/builders/EmbedBuilder.js +208 -0
  9. package/dist/cjs/builders/ModalBuilder.d.ts +122 -0
  10. package/dist/cjs/builders/ModalBuilder.js +162 -0
  11. package/dist/cjs/builders/SelectMenuBuilder.d.ts +123 -0
  12. package/dist/cjs/builders/SelectMenuBuilder.js +165 -0
  13. package/dist/cjs/builders/SlashCommandBuilder.d.ts +197 -0
  14. package/dist/cjs/builders/SlashCommandBuilder.js +324 -0
  15. package/dist/cjs/builders/index.d.ts +9 -0
  16. package/dist/cjs/builders/index.js +26 -0
  17. package/dist/cjs/enums.d.ts +191 -0
  18. package/dist/cjs/enums.js +211 -0
  19. package/dist/cjs/index.d.ts +25 -0
  20. package/dist/cjs/index.js +130 -0
  21. package/dist/cjs/managers/BaseManager.d.ts +69 -0
  22. package/dist/cjs/managers/BaseManager.js +106 -0
  23. package/dist/cjs/managers/ChannelManager.d.ts +95 -0
  24. package/dist/cjs/managers/ChannelManager.js +205 -0
  25. package/dist/cjs/managers/GuildMemberManager.d.ts +74 -0
  26. package/dist/cjs/managers/GuildMemberManager.js +157 -0
  27. package/dist/cjs/managers/RoleManager.d.ts +84 -0
  28. package/dist/cjs/managers/RoleManager.js +207 -0
  29. package/dist/cjs/managers/index.d.ts +7 -0
  30. package/dist/cjs/managers/index.js +24 -0
  31. package/dist/cjs/rest/REST.d.ts +527 -0
  32. package/dist/cjs/rest/REST.js +904 -0
  33. package/dist/cjs/rest/index.d.ts +1 -0
  34. package/dist/cjs/rest/index.js +18 -0
  35. package/dist/cjs/sharding/ShardingManager.d.ts +179 -0
  36. package/dist/cjs/sharding/ShardingManager.js +375 -0
  37. package/dist/cjs/sharding/index.d.ts +4 -0
  38. package/dist/cjs/sharding/index.js +21 -0
  39. package/dist/cjs/structures/Channel.d.ts +122 -0
  40. package/dist/cjs/structures/Channel.js +240 -0
  41. package/dist/cjs/structures/Collection.d.ts +53 -0
  42. package/dist/cjs/structures/Collection.js +115 -0
  43. package/dist/cjs/structures/Guild.d.ts +59 -0
  44. package/dist/cjs/structures/Guild.js +94 -0
  45. package/dist/cjs/structures/GuildMember.d.ts +174 -0
  46. package/dist/cjs/structures/GuildMember.js +311 -0
  47. package/dist/cjs/structures/Interaction.d.ts +245 -0
  48. package/dist/cjs/structures/Interaction.js +450 -0
  49. package/dist/cjs/structures/Message.d.ts +98 -0
  50. package/dist/cjs/structures/Message.js +195 -0
  51. package/dist/cjs/structures/User.d.ts +37 -0
  52. package/dist/cjs/structures/User.js +65 -0
  53. package/dist/cjs/structures/index.d.ts +7 -0
  54. package/dist/cjs/structures/index.js +25 -0
  55. package/dist/cjs/structures.d.ts +1 -0
  56. package/dist/cjs/structures.js +19 -0
  57. package/dist/cjs/types.d.ts +255 -0
  58. package/dist/cjs/types.js +3 -0
  59. package/dist/cjs/utils/BitField.d.ts +66 -0
  60. package/dist/cjs/utils/BitField.js +138 -0
  61. package/dist/cjs/utils/Collection.d.ts +116 -0
  62. package/dist/cjs/utils/Collection.js +265 -0
  63. package/dist/cjs/utils/Collector.d.ts +152 -0
  64. package/dist/cjs/utils/Collector.js +314 -0
  65. package/dist/cjs/utils/DataResolver.d.ts +61 -0
  66. package/dist/cjs/utils/DataResolver.js +146 -0
  67. package/dist/cjs/utils/Formatters.d.ts +145 -0
  68. package/dist/cjs/utils/Formatters.js +213 -0
  69. package/dist/cjs/utils/IntentsBitField.d.ts +85 -0
  70. package/dist/cjs/utils/IntentsBitField.js +99 -0
  71. package/dist/cjs/utils/Partials.d.ts +104 -0
  72. package/dist/cjs/utils/Partials.js +148 -0
  73. package/dist/cjs/utils/PermissionsBitField.d.ts +118 -0
  74. package/dist/cjs/utils/PermissionsBitField.js +145 -0
  75. package/dist/cjs/utils/SnowflakeUtil.d.ts +63 -0
  76. package/dist/cjs/utils/SnowflakeUtil.js +93 -0
  77. package/dist/cjs/utils/Sweepers.d.ts +119 -0
  78. package/dist/cjs/utils/Sweepers.js +249 -0
  79. package/dist/cjs/utils/index.d.ts +13 -0
  80. package/dist/cjs/utils/index.js +30 -0
  81. package/dist/esm/Client.js +634 -0
  82. package/dist/esm/builders/ActionRowBuilder.js +64 -0
  83. package/dist/esm/builders/ButtonBuilder.js +92 -0
  84. package/dist/esm/builders/EmbedBuilder.js +204 -0
  85. package/dist/esm/builders/ModalBuilder.js +157 -0
  86. package/dist/esm/builders/SelectMenuBuilder.js +161 -0
  87. package/dist/esm/builders/SlashCommandBuilder.js +311 -0
  88. package/dist/esm/builders/index.js +10 -0
  89. package/dist/esm/enums.js +208 -0
  90. package/dist/esm/index.js +34 -0
  91. package/dist/esm/managers/BaseManager.js +100 -0
  92. package/dist/esm/managers/ChannelManager.js +200 -0
  93. package/dist/esm/managers/GuildMemberManager.js +153 -0
  94. package/dist/esm/managers/RoleManager.js +203 -0
  95. package/dist/esm/managers/index.js +8 -0
  96. package/dist/esm/rest/REST.js +900 -0
  97. package/dist/esm/rest/index.js +2 -0
  98. package/dist/esm/sharding/ShardingManager.js +366 -0
  99. package/dist/esm/sharding/index.js +5 -0
  100. package/dist/esm/structures/Channel.js +232 -0
  101. package/dist/esm/structures/Collection.js +111 -0
  102. package/dist/esm/structures/Guild.js +90 -0
  103. package/dist/esm/structures/GuildMember.js +306 -0
  104. package/dist/esm/structures/Interaction.js +438 -0
  105. package/dist/esm/structures/Message.js +191 -0
  106. package/dist/esm/structures/User.js +61 -0
  107. package/dist/esm/structures/index.js +9 -0
  108. package/dist/esm/structures.js +3 -0
  109. package/dist/esm/types.js +2 -0
  110. package/dist/esm/utils/BitField.js +134 -0
  111. package/dist/esm/utils/Collection.js +261 -0
  112. package/dist/esm/utils/Collector.js +305 -0
  113. package/dist/esm/utils/DataResolver.js +142 -0
  114. package/dist/esm/utils/Formatters.js +191 -0
  115. package/dist/esm/utils/IntentsBitField.js +93 -0
  116. package/dist/esm/utils/Partials.js +137 -0
  117. package/dist/esm/utils/PermissionsBitField.js +141 -0
  118. package/dist/esm/utils/SnowflakeUtil.js +89 -0
  119. package/dist/esm/utils/Sweepers.js +245 -0
  120. package/dist/esm/utils/index.js +14 -0
  121. package/package.json +14 -4
@@ -0,0 +1,245 @@
1
+ import { APIInteraction, APIInteractionOption, APIEmbed } from '../types';
2
+ import { InteractionType } from '../enums';
3
+ import { User } from './User';
4
+ import { GuildMember } from './GuildMember';
5
+ import { EmbedBuilder } from '../builders/EmbedBuilder';
6
+ import type { Client } from '../Client';
7
+ /**
8
+ * Base interaction class
9
+ */
10
+ export declare class Interaction {
11
+ /** Reference to the client */
12
+ readonly client: Client;
13
+ /** Interaction ID */
14
+ readonly id: string;
15
+ /** Application ID */
16
+ readonly applicationId: string;
17
+ /** Interaction type */
18
+ readonly type: InteractionType;
19
+ /** Guild ID */
20
+ readonly guildId?: string;
21
+ /** Channel ID */
22
+ readonly channelId?: string;
23
+ /** Interaction token */
24
+ readonly token: string;
25
+ /** User who triggered the interaction */
26
+ readonly user: User;
27
+ /** Guild member (if in a guild) */
28
+ readonly member?: GuildMember;
29
+ /** Whether the interaction has been replied to */
30
+ replied: boolean;
31
+ /** Whether the interaction has been deferred */
32
+ deferred: boolean;
33
+ constructor(client: Client, data: APIInteraction);
34
+ /**
35
+ * Check if this is a command interaction
36
+ */
37
+ isCommand(): this is CommandInteraction;
38
+ /**
39
+ * Check if this is an autocomplete interaction
40
+ */
41
+ isAutocomplete(): this is AutocompleteInteraction;
42
+ /**
43
+ * Check if this is a modal submit interaction
44
+ */
45
+ isModalSubmit(): this is ModalSubmitInteraction;
46
+ /**
47
+ * Check if this is a button interaction
48
+ */
49
+ isButton(): this is ButtonInteraction;
50
+ /**
51
+ * Check if this is a select menu interaction
52
+ */
53
+ isSelectMenu(): this is SelectMenuInteraction;
54
+ /**
55
+ * Reply to the interaction
56
+ */
57
+ reply(options: string | InteractionReplyOptions): Promise<void>;
58
+ /**
59
+ * Defer the reply (shows "thinking...")
60
+ */
61
+ deferReply(options?: {
62
+ ephemeral?: boolean;
63
+ }): Promise<void>;
64
+ /**
65
+ * Edit the reply
66
+ */
67
+ editReply(options: string | InteractionReplyOptions): Promise<void>;
68
+ /**
69
+ * Delete the reply
70
+ */
71
+ deleteReply(): Promise<void>;
72
+ /**
73
+ * Send a followup message
74
+ */
75
+ followUp(options: string | InteractionReplyOptions): Promise<void>;
76
+ }
77
+ /**
78
+ * Command interaction
79
+ */
80
+ export declare class CommandInteraction extends Interaction {
81
+ /** Command name */
82
+ readonly commandName: string;
83
+ /** Command options */
84
+ readonly options: CommandInteractionOptions;
85
+ constructor(client: Client, data: APIInteraction);
86
+ /**
87
+ * Show a modal
88
+ */
89
+ showModal(modal: ModalData | {
90
+ toJSON(): ModalData;
91
+ }): Promise<void>;
92
+ }
93
+ /**
94
+ * Command interaction options helper
95
+ */
96
+ export declare class CommandInteractionOptions {
97
+ private options;
98
+ constructor(options: APIInteractionOption[]);
99
+ /**
100
+ * Get a string option
101
+ */
102
+ getString(name: string, required?: boolean): string | null;
103
+ /**
104
+ * Get an integer option
105
+ */
106
+ getInteger(name: string, required?: boolean): number | null;
107
+ /**
108
+ * Get a number option
109
+ */
110
+ getNumber(name: string, required?: boolean): number | null;
111
+ /**
112
+ * Get a boolean option
113
+ */
114
+ getBoolean(name: string, required?: boolean): boolean | null;
115
+ /**
116
+ * Get a user option
117
+ */
118
+ getUser(name: string, required?: boolean): string | null;
119
+ /**
120
+ * Get a channel option
121
+ */
122
+ getChannel(name: string, required?: boolean): string | null;
123
+ /**
124
+ * Get a subcommand name
125
+ */
126
+ getSubcommand(required?: boolean): string | null;
127
+ /**
128
+ * Get the focused option (for autocomplete)
129
+ */
130
+ getFocused(): {
131
+ name: string;
132
+ value: string;
133
+ } | null;
134
+ }
135
+ /**
136
+ * Autocomplete interaction
137
+ */
138
+ export declare class AutocompleteInteraction extends Interaction {
139
+ /** Command name */
140
+ readonly commandName: string;
141
+ /** Command options */
142
+ readonly options: CommandInteractionOptions;
143
+ constructor(client: Client, data: APIInteraction);
144
+ /**
145
+ * Respond with autocomplete choices
146
+ */
147
+ respond(choices: AutocompleteChoice[]): Promise<void>;
148
+ }
149
+ /**
150
+ * Button interaction
151
+ */
152
+ export declare class ButtonInteraction extends Interaction {
153
+ /** Button custom ID */
154
+ readonly customId: string;
155
+ /** Component type (always 2 for buttons) */
156
+ readonly componentType: number;
157
+ /** Message the button is attached to */
158
+ readonly message?: any;
159
+ constructor(client: Client, data: APIInteraction);
160
+ /**
161
+ * Update the message the button is attached to
162
+ */
163
+ update(options: InteractionReplyOptions): Promise<void>;
164
+ /**
165
+ * Show a modal in response to this button interaction
166
+ */
167
+ showModal(modal: ModalData | {
168
+ toJSON(): ModalData;
169
+ }): Promise<void>;
170
+ }
171
+ /**
172
+ * Select menu interaction
173
+ */
174
+ export declare class SelectMenuInteraction extends Interaction {
175
+ /** Select menu custom ID */
176
+ readonly customId: string;
177
+ /** Component type (always 3 for select menus) */
178
+ readonly componentType: number;
179
+ /** Selected values */
180
+ readonly values: string[];
181
+ /** Message the select menu is attached to */
182
+ readonly message?: any;
183
+ constructor(client: Client, data: APIInteraction);
184
+ /**
185
+ * Update the message the select menu is attached to
186
+ */
187
+ update(options: InteractionReplyOptions): Promise<void>;
188
+ /**
189
+ * Show a modal in response to this select menu interaction
190
+ */
191
+ showModal(modal: ModalData | {
192
+ toJSON(): ModalData;
193
+ }): Promise<void>;
194
+ }
195
+ /**
196
+ * Modal submit interaction
197
+ */
198
+ export declare class ModalSubmitInteraction extends Interaction {
199
+ /** Modal custom ID */
200
+ readonly customId: string;
201
+ /** Modal fields */
202
+ readonly fields: ModalFields;
203
+ constructor(client: Client, data: APIInteraction);
204
+ }
205
+ /**
206
+ * Modal fields helper
207
+ */
208
+ export declare class ModalFields {
209
+ private fieldMap;
210
+ constructor(components: any[]);
211
+ /**
212
+ * Get a text input value by custom_id
213
+ */
214
+ getTextInputValue(customId: string): string | null;
215
+ /**
216
+ * Get a field (alias for getTextInputValue)
217
+ */
218
+ getField(customId: string): {
219
+ value: string;
220
+ } | null;
221
+ }
222
+ export interface InteractionReplyOptions {
223
+ content?: string;
224
+ embeds?: (APIEmbed | EmbedBuilder)[];
225
+ components?: any[];
226
+ ephemeral?: boolean;
227
+ files?: Array<{
228
+ name: string;
229
+ data: Buffer;
230
+ contentType?: string;
231
+ }>;
232
+ }
233
+ export interface AutocompleteChoice {
234
+ name: string;
235
+ value: string | number;
236
+ }
237
+ export interface ModalData {
238
+ custom_id: string;
239
+ title: string;
240
+ components: any[];
241
+ }
242
+ /**
243
+ * Create appropriate interaction class based on type
244
+ */
245
+ export declare function createInteraction(client: Client, data: APIInteraction): Interaction;