@spatulox/simplediscordbot 1.6.1 → 1.6.3

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/.env.example CHANGED
@@ -1,2 +1,2 @@
1
- DISCORD_BOT_TOKEN=example
1
+ DISCORD_BOT_TOKEN=example
2
2
  DISCORD_BOT_DEV # Define this one with anything you want, the value is not important as long as the env var is defined
package/LICENSE.md CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Spatulox
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Spatulox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  > - Include the [DiscordInterationManager](https://github.com/Spatulox/DiscordInteractionManager) package
13
13
  > - Simple Log package
14
14
  > - Provides easy Managers to avoid repetitive code everywhere
15
- > - Simple yet powerful builders (Embeds, Modals, SelectMenus, Components) that rely on discord.js for full compatibility
15
+ > - Simple yet powerful builders (Embeds, Modals, SelectMenus, Components, Buttons) that rely on discord.js for full compatibility
16
16
 
17
17
 
18
18
  ## Installation
@@ -29,7 +29,7 @@ DISCORD_BOT_CLIENTID="" // Yout bot client id
29
29
  ```
30
30
 
31
31
  ```typescript
32
- import {Bot, BotConfig, EmbedColor, Time} from "@spatulox/simplediscordbot";
32
+ import {Bot, BotConfig, SimpleColor, Time} from "@spatulox/simplediscordbot";
33
33
  import {Client, Events, GatewayIntentBits} from "discord.js";
34
34
 
35
35
  const client = new Client({
@@ -37,7 +37,7 @@ const client = new Client({
37
37
  });
38
38
 
39
39
  const config: BotConfig = {
40
- defaultEmbedColor: EmbedColor.blue,
40
+ defaultSimpleColor: SimpleColor.blue,
41
41
  botName: "Simple Discord Bot",
42
42
  log: {
43
43
  logChannelId: "YOUR_LOG_CHANNEL_ID",
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { EmbedBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, MessageCreateOptions, TextChannel, DMChannel, ThreadChannel, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, Snowflake, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ContainerBuilder, ButtonBuilder, AttachmentBuilder, ButtonStyle } from 'discord.js';
1
+ import { EmbedBuilder, ContainerBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, TextChannel, DMChannel, ThreadChannel, MessageCreateOptions, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, Snowflake, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ButtonBuilder, AttachmentBuilder, ButtonStyle } from 'discord.js';
2
2
 
3
- type SendableComponent = EmbedBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
3
+ type SendableComponent = EmbedBuilder | ContainerBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
4
4
 
5
5
  type ConfigLog = {
6
6
  logChannelId: string;
@@ -53,7 +53,44 @@ declare class BotLog {
53
53
  static debug(content: string | SendableComponent): Promise<Message | void>;
54
54
  }
55
55
 
56
- declare enum EmbedColor {
56
+ declare class BotMessage {
57
+ /**
58
+ * Send message to any text-based channel
59
+ */
60
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message | null>;
61
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message | null>;
62
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message | null>;
63
+ static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message | null>;
64
+ /**
65
+ * Quick success message
66
+ */
67
+ static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
68
+ /**
69
+ * Quick error message
70
+ */
71
+ static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
72
+ }
73
+
74
+ declare class BotInteraction {
75
+ /**
76
+ * InteractionReplyOptions && InteractionUpdateOptions
77
+ * The two have "content", "embeds" & "flags" field, so an internal cast is ok, unless discord/discordjs deprecate it
78
+ */
79
+ private static buildReplyOptions;
80
+ private static buildUpdateOptions;
81
+ private static _buildOptions;
82
+ static send(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
83
+ static send(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
84
+ static reply(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
85
+ static reply(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
86
+ static followUp(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
87
+ static followUp(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
88
+ static defer(interaction: BaseInteraction): Promise<void>;
89
+ static update(interaction: BaseInteraction, content: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
90
+ static update(interaction: BaseInteraction, content: string, component: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
91
+ }
92
+
93
+ declare enum SimpleColor {
57
94
  transparent = "transparent",
58
95
  error = 8912917,
59
96
  success = 65280,
@@ -92,95 +129,9 @@ declare enum EmbedColor {
92
129
  default = 6064856,
93
130
  minecraft = 25600
94
131
  }
95
- declare class EmbedManager {
96
- private static get BOT_ICON();
97
- private static get DEFAULT_COLOR();
98
- /**
99
- * Creates base embed - SAME SIMPLE API !
100
- */
101
- static create(color?: EmbedColor | null): EmbedBuilder;
102
- /**
103
- * Creates simple embed with just description
104
- */
105
- static simple(description: string, color?: EmbedColor | null): EmbedBuilder;
106
- /**
107
- * Creates error embed
108
- */
109
- static error(description: string): EmbedBuilder;
110
- /**
111
- * Creates success embed
112
- */
113
- static success(description: string): EmbedBuilder;
114
- /**
115
- * Creates a simple description embed
116
- */
117
- static description(description: string): EmbedBuilder;
118
- /**
119
- * Creates debug embed
120
- */
121
- static debug(description: string): EmbedBuilder;
122
- /**
123
- * Defer ephemeral reply
124
- */
125
- static deferEphemeral(): InteractionDeferReplyOptions;
126
- /**
127
- * Quick field adder
128
- */
129
- static field(embed: EmbedBuilder, name: string, value: string, inline?: boolean): EmbedBuilder;
130
- static fields(embed: EmbedBuilder, fields: {
131
- name: string;
132
- value: string;
133
- inline?: boolean;
134
- }[]): EmbedBuilder;
135
- /**
136
- * Transform embed into objet for interaction.reply()
137
- */
138
- static toInteraction(embed: EmbedBuilder, ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
139
- /**
140
- * Transform embed into objet to send a message
141
- */
142
- static toMessage(embed: EmbedBuilder): MessageCreateOptions;
143
- }
144
-
145
- declare class BotMessage {
146
- /**
147
- * Send message to any text-based channel
148
- */
149
- static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message | null>;
150
- static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message | null>;
151
- static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message | null>;
152
- static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message | null>;
153
- /**
154
- * Quick success message
155
- */
156
- static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
157
- /**
158
- * Quick error message
159
- */
160
- static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
161
- }
162
-
163
- declare class BotInteraction {
164
- /**
165
- * InteractionReplyOptions && InteractionUpdateOptions
166
- * The two have "content", "embeds" & "flags" field, so an internal cast is ok, unless discord/discordjs deprecate it
167
- */
168
- private static buildReplyOptions;
169
- private static buildUpdateOptions;
170
- private static _buildOptions;
171
- static send(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
172
- static send(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
173
- static reply(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
174
- static reply(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
175
- static followUp(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
176
- static followUp(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
177
- static defer(interaction: BaseInteraction): Promise<void>;
178
- static update(interaction: BaseInteraction, content: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
179
- static update(interaction: BaseInteraction, content: string, component: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
180
- }
181
132
 
182
133
  type BotConfig = {
183
- defaultEmbedColor?: number | EmbedColor;
134
+ defaultSimpleColor?: number | SimpleColor;
184
135
  botName?: string;
185
136
  log?: ConfigLog;
186
137
  };
@@ -251,6 +202,60 @@ declare class FileManager {
251
202
  static writeJsonFile(directoryPath: string, filename: string, data: any, sendErrorToErrorChannel?: boolean): Promise<boolean>;
252
203
  }
253
204
 
205
+ declare class EmbedManager {
206
+ private static get BOT_ICON();
207
+ private static get DEFAULT_COLOR();
208
+ /**
209
+ * Creates base embed - SAME SIMPLE API !
210
+ */
211
+ static create(color?: SimpleColor | null): EmbedBuilder;
212
+ /**
213
+ * Creates simple embed with just description
214
+ */
215
+ static simple(description: string, color?: SimpleColor | null): EmbedBuilder;
216
+ /**
217
+ * Creates error embed
218
+ */
219
+ static error(description: string): EmbedBuilder;
220
+ /**
221
+ * Creates success embed
222
+ */
223
+ static success(description: string): EmbedBuilder;
224
+ /**
225
+ * Creates a simple description embed
226
+ */
227
+ static description(description: string): EmbedBuilder;
228
+ /**
229
+ * Creates debug embed
230
+ */
231
+ static debug(description: string): EmbedBuilder;
232
+ /**
233
+ * Defer ephemeral reply
234
+ */
235
+ static deferEphemeral(): InteractionDeferReplyOptions;
236
+ /**
237
+ * Quick field adder
238
+ */
239
+ static field(embed: EmbedBuilder, name: string, value: string, inline?: boolean): EmbedBuilder;
240
+ static fields(embed: EmbedBuilder, fields: {
241
+ name: string;
242
+ value: string;
243
+ inline?: boolean;
244
+ }[]): EmbedBuilder;
245
+ /**
246
+ * Transform embed into objet for interaction.reply()
247
+ */
248
+ static toInteraction(embed: EmbedBuilder, ephemeral?: boolean): InteractionReplyOptions;
249
+ /**
250
+ * Transform embed into objet for interaction.editReply()
251
+ */
252
+ static toInteractionEdit(embed: EmbedBuilder): InteractionEditReplyOptions;
253
+ /**
254
+ * Transform embed into objet to send a message
255
+ */
256
+ static toMessage(embed: EmbedBuilder): MessageCreateOptions;
257
+ }
258
+
254
259
  declare class WebhookManager {
255
260
  private readonly channel;
256
261
  private readonly name;
@@ -665,7 +670,8 @@ declare class SelectMenuManager {
665
670
  */
666
671
  static rows(...components: MessageActionRowComponentBuilder[]): ActionRowBuilder<MessageActionRowComponentBuilder>[];
667
672
  static toMessage(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[]): MessageCreateOptions;
668
- static toInteraction(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[], ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
673
+ static toInteraction(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[], ephemeral?: boolean): InteractionReplyOptions;
674
+ static toInteractionEdit(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[]): InteractionEditReplyOptions;
669
675
  private static _createRowsToReturn;
670
676
  }
671
677
 
@@ -684,7 +690,7 @@ type ComponentManagerField = ComponentManagerFieldAccessory | ComponentManagerFi
684
690
  interface ComponentManagerCreate {
685
691
  title?: string | null;
686
692
  description?: string | null;
687
- color?: EmbedColor | null;
693
+ color?: SimpleColor | null;
688
694
  thumbnailUrl?: string;
689
695
  separator?: SeparatorSpacingSize | false;
690
696
  }
@@ -702,7 +708,7 @@ declare class ComponentManager {
702
708
  /**
703
709
  * Creates simple ComponentV2 with just description
704
710
  */
705
- static simple(description: string, color?: EmbedColor | null): ContainerBuilder;
711
+ static simple(description: string, color?: SimpleColor | null): ContainerBuilder;
706
712
  /**
707
713
  * Creates success ComponentV2
708
714
  */
@@ -757,6 +763,8 @@ declare class ComponentManager {
757
763
  * @param footer Sometimes you don't want to have the Bot name neither the timestamp...
758
764
  */
759
765
  static toMessage(container: ContainerBuilder, file?: AttachmentBuilder | AttachmentBuilder[] | null, footer?: boolean): MessageCreateOptions;
766
+ static toInteraction(container: ContainerBuilder, file?: AttachmentBuilder | AttachmentBuilder[] | null, footer?: boolean): InteractionReplyOptions;
767
+ static toInteractionEdit(container: ContainerBuilder, file?: AttachmentBuilder | AttachmentBuilder[] | null, footer?: boolean): InteractionEditReplyOptions;
760
768
  }
761
769
 
762
770
  interface ButtonOptions {
@@ -782,7 +790,8 @@ declare class ButtonManager {
782
790
  static row(but: ButtonBuilder): ActionRowBuilder<ButtonBuilder>;
783
791
  static row(but: ButtonBuilder[]): ActionRowBuilder<ButtonBuilder>;
784
792
  static toMessage(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[]): MessageCreateOptions;
785
- static toInteraction(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[], ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
793
+ static toInteraction(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[], ephemeral?: boolean): InteractionReplyOptions;
794
+ static toInteractionEdit(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[]): InteractionEditReplyOptions;
786
795
  private static createRowsToReturn;
787
796
  }
788
797
 
@@ -1071,4 +1080,4 @@ declare const SimpleDiscordBotInfo: {
1071
1080
  license: string;
1072
1081
  };
1073
1082
 
1074
- export { Bot, type BotConfig, BotEnv, ButtonManager, ComponentManager, type ComponentManagerField, DiscordRegex, EmbedColor, EmbedManager, FileManager, GuildManager, Log, type ModalField, ModalFieldType, ModalManager, type RandomBotActivity, ReactionManager, SelectMenuManager, SimpleDiscordBotInfo, SimpleMutex, Time, UserManager, WebhookManager };
1083
+ export { Bot, type BotConfig, BotEnv, ButtonManager, type ButtonOptions, ComponentManager, type ComponentManagerCreate, type ComponentManagerField, type ComponentManagerFileInput, DiscordRegex, EmbedManager, FileManager, GuildManager, Log, type ModalField, ModalFieldType, ModalManager, type RandomBotActivity, ReactionManager, type SelectMenuCreateOption, type SelectMenuList, SelectMenuManager, SimpleColor, SimpleDiscordBotInfo, SimpleMutex, Time, UserManager, WebhookManager };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { EmbedBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, MessageCreateOptions, TextChannel, DMChannel, ThreadChannel, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, Snowflake, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ContainerBuilder, ButtonBuilder, AttachmentBuilder, ButtonStyle } from 'discord.js';
1
+ import { EmbedBuilder, ContainerBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, TextChannel, DMChannel, ThreadChannel, MessageCreateOptions, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, Snowflake, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ButtonBuilder, AttachmentBuilder, ButtonStyle } from 'discord.js';
2
2
 
3
- type SendableComponent = EmbedBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
3
+ type SendableComponent = EmbedBuilder | ContainerBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
4
4
 
5
5
  type ConfigLog = {
6
6
  logChannelId: string;
@@ -53,7 +53,44 @@ declare class BotLog {
53
53
  static debug(content: string | SendableComponent): Promise<Message | void>;
54
54
  }
55
55
 
56
- declare enum EmbedColor {
56
+ declare class BotMessage {
57
+ /**
58
+ * Send message to any text-based channel
59
+ */
60
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message | null>;
61
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message | null>;
62
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message | null>;
63
+ static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message | null>;
64
+ /**
65
+ * Quick success message
66
+ */
67
+ static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
68
+ /**
69
+ * Quick error message
70
+ */
71
+ static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
72
+ }
73
+
74
+ declare class BotInteraction {
75
+ /**
76
+ * InteractionReplyOptions && InteractionUpdateOptions
77
+ * The two have "content", "embeds" & "flags" field, so an internal cast is ok, unless discord/discordjs deprecate it
78
+ */
79
+ private static buildReplyOptions;
80
+ private static buildUpdateOptions;
81
+ private static _buildOptions;
82
+ static send(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
83
+ static send(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
84
+ static reply(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
85
+ static reply(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
86
+ static followUp(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
87
+ static followUp(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
88
+ static defer(interaction: BaseInteraction): Promise<void>;
89
+ static update(interaction: BaseInteraction, content: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
90
+ static update(interaction: BaseInteraction, content: string, component: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
91
+ }
92
+
93
+ declare enum SimpleColor {
57
94
  transparent = "transparent",
58
95
  error = 8912917,
59
96
  success = 65280,
@@ -92,95 +129,9 @@ declare enum EmbedColor {
92
129
  default = 6064856,
93
130
  minecraft = 25600
94
131
  }
95
- declare class EmbedManager {
96
- private static get BOT_ICON();
97
- private static get DEFAULT_COLOR();
98
- /**
99
- * Creates base embed - SAME SIMPLE API !
100
- */
101
- static create(color?: EmbedColor | null): EmbedBuilder;
102
- /**
103
- * Creates simple embed with just description
104
- */
105
- static simple(description: string, color?: EmbedColor | null): EmbedBuilder;
106
- /**
107
- * Creates error embed
108
- */
109
- static error(description: string): EmbedBuilder;
110
- /**
111
- * Creates success embed
112
- */
113
- static success(description: string): EmbedBuilder;
114
- /**
115
- * Creates a simple description embed
116
- */
117
- static description(description: string): EmbedBuilder;
118
- /**
119
- * Creates debug embed
120
- */
121
- static debug(description: string): EmbedBuilder;
122
- /**
123
- * Defer ephemeral reply
124
- */
125
- static deferEphemeral(): InteractionDeferReplyOptions;
126
- /**
127
- * Quick field adder
128
- */
129
- static field(embed: EmbedBuilder, name: string, value: string, inline?: boolean): EmbedBuilder;
130
- static fields(embed: EmbedBuilder, fields: {
131
- name: string;
132
- value: string;
133
- inline?: boolean;
134
- }[]): EmbedBuilder;
135
- /**
136
- * Transform embed into objet for interaction.reply()
137
- */
138
- static toInteraction(embed: EmbedBuilder, ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
139
- /**
140
- * Transform embed into objet to send a message
141
- */
142
- static toMessage(embed: EmbedBuilder): MessageCreateOptions;
143
- }
144
-
145
- declare class BotMessage {
146
- /**
147
- * Send message to any text-based channel
148
- */
149
- static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message | null>;
150
- static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message | null>;
151
- static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message | null>;
152
- static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message | null>;
153
- /**
154
- * Quick success message
155
- */
156
- static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
157
- /**
158
- * Quick error message
159
- */
160
- static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
161
- }
162
-
163
- declare class BotInteraction {
164
- /**
165
- * InteractionReplyOptions && InteractionUpdateOptions
166
- * The two have "content", "embeds" & "flags" field, so an internal cast is ok, unless discord/discordjs deprecate it
167
- */
168
- private static buildReplyOptions;
169
- private static buildUpdateOptions;
170
- private static _buildOptions;
171
- static send(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
172
- static send(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
173
- static reply(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
174
- static reply(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
175
- static followUp(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
176
- static followUp(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
177
- static defer(interaction: BaseInteraction): Promise<void>;
178
- static update(interaction: BaseInteraction, content: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
179
- static update(interaction: BaseInteraction, content: string, component: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
180
- }
181
132
 
182
133
  type BotConfig = {
183
- defaultEmbedColor?: number | EmbedColor;
134
+ defaultSimpleColor?: number | SimpleColor;
184
135
  botName?: string;
185
136
  log?: ConfigLog;
186
137
  };
@@ -251,6 +202,60 @@ declare class FileManager {
251
202
  static writeJsonFile(directoryPath: string, filename: string, data: any, sendErrorToErrorChannel?: boolean): Promise<boolean>;
252
203
  }
253
204
 
205
+ declare class EmbedManager {
206
+ private static get BOT_ICON();
207
+ private static get DEFAULT_COLOR();
208
+ /**
209
+ * Creates base embed - SAME SIMPLE API !
210
+ */
211
+ static create(color?: SimpleColor | null): EmbedBuilder;
212
+ /**
213
+ * Creates simple embed with just description
214
+ */
215
+ static simple(description: string, color?: SimpleColor | null): EmbedBuilder;
216
+ /**
217
+ * Creates error embed
218
+ */
219
+ static error(description: string): EmbedBuilder;
220
+ /**
221
+ * Creates success embed
222
+ */
223
+ static success(description: string): EmbedBuilder;
224
+ /**
225
+ * Creates a simple description embed
226
+ */
227
+ static description(description: string): EmbedBuilder;
228
+ /**
229
+ * Creates debug embed
230
+ */
231
+ static debug(description: string): EmbedBuilder;
232
+ /**
233
+ * Defer ephemeral reply
234
+ */
235
+ static deferEphemeral(): InteractionDeferReplyOptions;
236
+ /**
237
+ * Quick field adder
238
+ */
239
+ static field(embed: EmbedBuilder, name: string, value: string, inline?: boolean): EmbedBuilder;
240
+ static fields(embed: EmbedBuilder, fields: {
241
+ name: string;
242
+ value: string;
243
+ inline?: boolean;
244
+ }[]): EmbedBuilder;
245
+ /**
246
+ * Transform embed into objet for interaction.reply()
247
+ */
248
+ static toInteraction(embed: EmbedBuilder, ephemeral?: boolean): InteractionReplyOptions;
249
+ /**
250
+ * Transform embed into objet for interaction.editReply()
251
+ */
252
+ static toInteractionEdit(embed: EmbedBuilder): InteractionEditReplyOptions;
253
+ /**
254
+ * Transform embed into objet to send a message
255
+ */
256
+ static toMessage(embed: EmbedBuilder): MessageCreateOptions;
257
+ }
258
+
254
259
  declare class WebhookManager {
255
260
  private readonly channel;
256
261
  private readonly name;
@@ -665,7 +670,8 @@ declare class SelectMenuManager {
665
670
  */
666
671
  static rows(...components: MessageActionRowComponentBuilder[]): ActionRowBuilder<MessageActionRowComponentBuilder>[];
667
672
  static toMessage(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[]): MessageCreateOptions;
668
- static toInteraction(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[], ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
673
+ static toInteraction(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[], ephemeral?: boolean): InteractionReplyOptions;
674
+ static toInteractionEdit(menus: SelectMenuList | SelectMenuList[] | ActionRowBuilder<MessageActionRowComponentBuilder> | ActionRowBuilder<MessageActionRowComponentBuilder>[]): InteractionEditReplyOptions;
669
675
  private static _createRowsToReturn;
670
676
  }
671
677
 
@@ -684,7 +690,7 @@ type ComponentManagerField = ComponentManagerFieldAccessory | ComponentManagerFi
684
690
  interface ComponentManagerCreate {
685
691
  title?: string | null;
686
692
  description?: string | null;
687
- color?: EmbedColor | null;
693
+ color?: SimpleColor | null;
688
694
  thumbnailUrl?: string;
689
695
  separator?: SeparatorSpacingSize | false;
690
696
  }
@@ -702,7 +708,7 @@ declare class ComponentManager {
702
708
  /**
703
709
  * Creates simple ComponentV2 with just description
704
710
  */
705
- static simple(description: string, color?: EmbedColor | null): ContainerBuilder;
711
+ static simple(description: string, color?: SimpleColor | null): ContainerBuilder;
706
712
  /**
707
713
  * Creates success ComponentV2
708
714
  */
@@ -757,6 +763,8 @@ declare class ComponentManager {
757
763
  * @param footer Sometimes you don't want to have the Bot name neither the timestamp...
758
764
  */
759
765
  static toMessage(container: ContainerBuilder, file?: AttachmentBuilder | AttachmentBuilder[] | null, footer?: boolean): MessageCreateOptions;
766
+ static toInteraction(container: ContainerBuilder, file?: AttachmentBuilder | AttachmentBuilder[] | null, footer?: boolean): InteractionReplyOptions;
767
+ static toInteractionEdit(container: ContainerBuilder, file?: AttachmentBuilder | AttachmentBuilder[] | null, footer?: boolean): InteractionEditReplyOptions;
760
768
  }
761
769
 
762
770
  interface ButtonOptions {
@@ -782,7 +790,8 @@ declare class ButtonManager {
782
790
  static row(but: ButtonBuilder): ActionRowBuilder<ButtonBuilder>;
783
791
  static row(but: ButtonBuilder[]): ActionRowBuilder<ButtonBuilder>;
784
792
  static toMessage(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[]): MessageCreateOptions;
785
- static toInteraction(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[], ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
793
+ static toInteraction(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[], ephemeral?: boolean): InteractionReplyOptions;
794
+ static toInteractionEdit(button: ButtonBuilder | ButtonBuilder[] | ActionRowBuilder<ButtonBuilder> | ActionRowBuilder<ButtonBuilder>[]): InteractionEditReplyOptions;
786
795
  private static createRowsToReturn;
787
796
  }
788
797
 
@@ -1071,4 +1080,4 @@ declare const SimpleDiscordBotInfo: {
1071
1080
  license: string;
1072
1081
  };
1073
1082
 
1074
- export { Bot, type BotConfig, BotEnv, ButtonManager, ComponentManager, type ComponentManagerField, DiscordRegex, EmbedColor, EmbedManager, FileManager, GuildManager, Log, type ModalField, ModalFieldType, ModalManager, type RandomBotActivity, ReactionManager, SelectMenuManager, SimpleDiscordBotInfo, SimpleMutex, Time, UserManager, WebhookManager };
1083
+ export { Bot, type BotConfig, BotEnv, ButtonManager, type ButtonOptions, ComponentManager, type ComponentManagerCreate, type ComponentManagerField, type ComponentManagerFileInput, DiscordRegex, EmbedManager, FileManager, GuildManager, Log, type ModalField, ModalFieldType, ModalManager, type RandomBotActivity, ReactionManager, type SelectMenuCreateOption, type SelectMenuList, SelectMenuManager, SimpleColor, SimpleDiscordBotInfo, SimpleMutex, Time, UserManager, WebhookManager };