@spatulox/simplediscordbot 1.0.37 → 1.0.38

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
@@ -1,51 +1,51 @@
1
-
2
- # Simple Discord Bot ![badge-status](https://img.shields.io/badge/status-active-brightgreen)
3
-
4
- [![npm version](https://img.shields.io/npm/v/@spatulox/simplediscordbot.svg)](https://npmjs.com/package/@spatulox/simplediscordbot)
5
- [![downloads](https://img.shields.io/npm/dm/@spatulox/simplediscordbot.svg)](https://npmjs.com/package/@spatulox/simplediscordbot)
6
- [![license](https://img.shields.io/npm/l/@spatulox/simplediscordbot.svg)](LICENSE)
7
-
8
- **Ultra-simple Framework Discord.js TypeScript**
9
-
10
- ## Installation
11
- ```bash
12
- npm i @spatulox/simplediscordbot
13
- ```
14
-
15
- > **TypeScript Discord.js framework** - Simple, powerful, framework-ready. Built for developers who want clean bot architecture.
16
- ## Quick Start
17
-
18
- Env Variables:
19
- ```bash
20
- DISCORD_BOT_TOKEN="" // Your bot Token
21
- DISCORD_BOT_CLIENTID="" // Yout bot client id
22
- ```
23
-
24
- ```typescript
25
- import {Bot, BotConfig, EmbedColor, Time} from "@spatulox/simplediscordbot";
26
- import {Client, Events, GatewayIntentBits} from "discord.js";
27
-
28
- const client = new Client({
29
- intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
30
- });
31
-
32
- const config: BotConfig = {
33
- defaultEmbedColor: EmbedColor.blue,
34
- botName: "Simple Discord Bot",
35
- log: {
36
- logChannelId: "YOUR_LOG_CHANNEL_ID",
37
- errorChannelId: "YOUR_ERROR_CHANNEL_ID",
38
- info: { console: true, discord: true },
39
- error: { console: true, discord: true },
40
- warn: { console: true, discord: true },
41
- debug: { console: true, discord: false }
42
- }
43
- };
44
-
45
- const bot = new Bot(client, config);
46
-
47
- bot.client.on(Events.ClientReady, async () => {
48
- Bot.setRandomActivity(randomActivityList, Time.minute.MIN_10.toMilliseconds());
49
- console.log("Bot ready! ✨");
50
- });
51
- ```
1
+
2
+ # Simple Discord Bot ![badge-status](https://img.shields.io/badge/status-active-brightgreen)
3
+
4
+ [![npm version](https://img.shields.io/npm/v/@spatulox/simplediscordbot.svg)](https://npmjs.com/package/@spatulox/simplediscordbot)
5
+ [![downloads](https://img.shields.io/npm/dm/@spatulox/simplediscordbot.svg)](https://npmjs.com/package/@spatulox/simplediscordbot)
6
+ [![license](https://img.shields.io/npm/l/@spatulox/simplediscordbot.svg)](LICENSE)
7
+
8
+ **Ultra-simple Framework Discord.js TypeScript**
9
+
10
+ ## Installation
11
+ ```bash
12
+ npm i @spatulox/simplediscordbot
13
+ ```
14
+
15
+ > **TypeScript Discord.js framework** - Simple, powerful, framework-ready. Built for developers who want clean bot architecture.
16
+ ## Quick Start
17
+
18
+ Env Variables:
19
+ ```bash
20
+ DISCORD_BOT_TOKEN="" // Your bot Token
21
+ DISCORD_BOT_CLIENTID="" // Yout bot client id
22
+ ```
23
+
24
+ ```typescript
25
+ import {Bot, BotConfig, EmbedColor, Time} from "@spatulox/simplediscordbot";
26
+ import {Client, Events, GatewayIntentBits} from "discord.js";
27
+
28
+ const client = new Client({
29
+ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
30
+ });
31
+
32
+ const config: BotConfig = {
33
+ defaultEmbedColor: EmbedColor.blue,
34
+ botName: "Simple Discord Bot",
35
+ log: {
36
+ logChannelId: "YOUR_LOG_CHANNEL_ID",
37
+ errorChannelId: "YOUR_ERROR_CHANNEL_ID",
38
+ info: { console: true, discord: true },
39
+ error: { console: true, discord: true },
40
+ warn: { console: true, discord: true },
41
+ debug: { console: true, discord: false }
42
+ }
43
+ };
44
+
45
+ const bot = new Bot(client, config);
46
+
47
+ bot.client.on(Events.ClientReady, async () => {
48
+ Bot.setRandomActivity(randomActivityList, Time.minute.MIN_10.toMilliseconds());
49
+ console.log("Bot ready! ✨");
50
+ });
51
+ ```
package/dist/index.js CHANGED
@@ -552,7 +552,7 @@ var EmbedManager = class {
552
552
  * Creates a simply description embed
553
553
  */
554
554
  static description(description) {
555
- return this.create().setDescription(description).setFooter(null);
555
+ return this.create().setDescription(description).setFooter(null).setTimestamp(null);
556
556
  }
557
557
  /**
558
558
  * Creates debug embed
@@ -641,20 +641,16 @@ var SendableComponentBuilder = class {
641
641
  }
642
642
  return base;
643
643
  }
644
- static buildInteraction(contentOrComponent, component, ephemeral = false) {
644
+ /*static buildInteraction (content: string, epheremal?: boolean): InteractionReplyOptions | InteractionUpdateOptions;
645
+ static buildInteraction (component: SendableComponent | SendableComponent[], epheremal?: boolean): InteractionReplyOptions | InteractionUpdateOptions;
646
+ static buildInteraction (content?: string | null, component?: SendableComponent | SendableComponent[] | null, ephemeral?: boolean): InteractionReplyOptions | InteractionUpdateOptions;*/
647
+ static buildInteraction(content, component, ephemeral) {
645
648
  let base = {};
646
- if (typeof contentOrComponent === "string" && !component) {
647
- base = this.build(base, contentOrComponent);
648
- }
649
- if (typeof contentOrComponent !== "string" && !component) {
650
- base = this.build(base, null, contentOrComponent);
651
- }
652
- if (contentOrComponent && typeof contentOrComponent === "string" && component) {
653
- base = this.build(base, contentOrComponent, component);
654
- }
655
- if (ephemeral) {
649
+ this.build(base, content, component);
650
+ if (ephemeral || typeof component == "boolean" && component) {
656
651
  base.flags = [import_discord3.MessageFlags.Ephemeral];
657
652
  }
653
+ console.log(base);
658
654
  return base;
659
655
  }
660
656
  static buildMessage(contentOrComponent, component) {
@@ -916,7 +912,7 @@ var BotInteraction = class {
916
912
  static async send(interaction, content, component = false, ephemeral = false) {
917
913
  if (!interaction.isRepliable()) return false;
918
914
  const options = this.buildReplyOptions(
919
- typeof content === "string" ? content : "",
915
+ typeof content === "string" ? content : null,
920
916
  typeof content === "string" ? component : content,
921
917
  typeof content === "string" ? ephemeral : component
922
918
  );
@@ -2532,7 +2528,7 @@ var SimpleMutex = class {
2532
2528
  // package.json
2533
2529
  var package_default = {
2534
2530
  name: "@spatulox/simplediscordbot",
2535
- version: "1.0.36",
2531
+ version: "1.0.37",
2536
2532
  author: "Spatulox",
2537
2533
  description: "Simple discord bot framework to set up a bot under 30 secondes",
2538
2534
  exports: {
@@ -2556,7 +2552,7 @@ var package_default = {
2556
2552
  },
2557
2553
  license: "MIT",
2558
2554
  dependencies: {
2559
- "@spatulox/discord-interaction-manager": "^1.0.15",
2555
+ "@spatulox/discord-interaction-manager": "^1.0.17",
2560
2556
  "discord.js": "^14.25.1"
2561
2557
  },
2562
2558
  devDependencies: {
package/dist/index.mjs CHANGED
@@ -504,7 +504,7 @@ var EmbedManager = class {
504
504
  * Creates a simply description embed
505
505
  */
506
506
  static description(description) {
507
- return this.create().setDescription(description).setFooter(null);
507
+ return this.create().setDescription(description).setFooter(null).setTimestamp(null);
508
508
  }
509
509
  /**
510
510
  * Creates debug embed
@@ -600,20 +600,16 @@ var SendableComponentBuilder = class {
600
600
  }
601
601
  return base;
602
602
  }
603
- static buildInteraction(contentOrComponent, component, ephemeral = false) {
603
+ /*static buildInteraction (content: string, epheremal?: boolean): InteractionReplyOptions | InteractionUpdateOptions;
604
+ static buildInteraction (component: SendableComponent | SendableComponent[], epheremal?: boolean): InteractionReplyOptions | InteractionUpdateOptions;
605
+ static buildInteraction (content?: string | null, component?: SendableComponent | SendableComponent[] | null, ephemeral?: boolean): InteractionReplyOptions | InteractionUpdateOptions;*/
606
+ static buildInteraction(content, component, ephemeral) {
604
607
  let base = {};
605
- if (typeof contentOrComponent === "string" && !component) {
606
- base = this.build(base, contentOrComponent);
607
- }
608
- if (typeof contentOrComponent !== "string" && !component) {
609
- base = this.build(base, null, contentOrComponent);
610
- }
611
- if (contentOrComponent && typeof contentOrComponent === "string" && component) {
612
- base = this.build(base, contentOrComponent, component);
613
- }
614
- if (ephemeral) {
608
+ this.build(base, content, component);
609
+ if (ephemeral || typeof component == "boolean" && component) {
615
610
  base.flags = [MessageFlags2.Ephemeral];
616
611
  }
612
+ console.log(base);
617
613
  return base;
618
614
  }
619
615
  static buildMessage(contentOrComponent, component) {
@@ -875,7 +871,7 @@ var BotInteraction = class {
875
871
  static async send(interaction, content, component = false, ephemeral = false) {
876
872
  if (!interaction.isRepliable()) return false;
877
873
  const options = this.buildReplyOptions(
878
- typeof content === "string" ? content : "",
874
+ typeof content === "string" ? content : null,
879
875
  typeof content === "string" ? component : content,
880
876
  typeof content === "string" ? ephemeral : component
881
877
  );
@@ -2510,7 +2506,7 @@ var SimpleMutex = class {
2510
2506
  // package.json
2511
2507
  var package_default = {
2512
2508
  name: "@spatulox/simplediscordbot",
2513
- version: "1.0.36",
2509
+ version: "1.0.37",
2514
2510
  author: "Spatulox",
2515
2511
  description: "Simple discord bot framework to set up a bot under 30 secondes",
2516
2512
  exports: {
@@ -2534,7 +2530,7 @@ var package_default = {
2534
2530
  },
2535
2531
  license: "MIT",
2536
2532
  dependencies: {
2537
- "@spatulox/discord-interaction-manager": "^1.0.15",
2533
+ "@spatulox/discord-interaction-manager": "^1.0.17",
2538
2534
  "discord.js": "^14.25.1"
2539
2535
  },
2540
2536
  devDependencies: {
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
- {
2
- "name": "@spatulox/simplediscordbot",
3
- "version": "1.0.37",
4
- "author": "Spatulox",
5
- "description": "Simple discord bot framework to set up a bot under 30 secondes",
6
- "exports": {
7
- "types": "./dist/index.d.ts",
8
- "import": "./dist/index.js",
9
- "require": "./dist/index.js"
10
- },
11
- "types": "./dist/index.d.ts",
12
- "scripts": {
13
- "build": "rm -r dist/ && tsup",
14
- "patch": "npm run build && npm version patch",
15
- "minor": "npm run build && npm version minor",
16
- "major": "npm run build && npm version major",
17
- "premajor": "npm run build && npm version premajor",
18
- "premajor:alpha": "npm run build && npm version premajor --preid=alpha",
19
- "pub": "npm run patch && npm publish --access public",
20
- "pub:major": "npm run major && npm publish --access public",
21
- "pub:alpha": "npm run premajor:alpha && npm publish --tag alpha --access public",
22
- "test-pack": "npm run patch && npm publish --access public",
23
- "dev": "nodemon --exec tsx src/test/index.ts"
24
- },
25
- "license": "MIT",
26
- "dependencies": {
27
- "@spatulox/discord-interaction-manager": "^1.0.15",
28
- "discord.js": "^14.25.1"
29
- },
30
- "devDependencies": {
31
- "@types/node": "^22.14.0",
32
- "@types/node-schedule": "^2.1.7",
33
- "dotenv": "^17.2.4",
34
- "nodemon": "^3.1.9",
35
- "tsup": "^8.5.1",
36
- "tsx": "^4.20.3",
37
- "typescript": "^5.9.3"
38
- },
39
- "keywords": [
40
- "discord",
41
- "framework",
42
- "bot",
43
- "client",
44
- "discordjs",
45
- "discord.js",
46
- "node"
47
- ],
48
- "bugs": {
49
- "url": "https://github.com/Spatulox/SimpleDiscordBot/issues"
50
- }
51
- }
1
+ {
2
+ "name": "@spatulox/simplediscordbot",
3
+ "version": "1.0.38",
4
+ "author": "Spatulox",
5
+ "description": "Simple discord bot framework to set up a bot under 30 secondes",
6
+ "exports": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.js"
10
+ },
11
+ "types": "./dist/index.d.ts",
12
+ "scripts": {
13
+ "build": "rm -r dist/ && tsup",
14
+ "patch": "npm run build && npm version patch",
15
+ "minor": "npm run build && npm version minor",
16
+ "major": "npm run build && npm version major",
17
+ "premajor": "npm run build && npm version premajor",
18
+ "premajor:alpha": "npm run build && npm version premajor --preid=alpha",
19
+ "pub": "npm run patch && npm publish --access public",
20
+ "pub:major": "npm run major && npm publish --access public",
21
+ "pub:alpha": "npm run premajor:alpha && npm publish --tag alpha --access public",
22
+ "test-pack": "npm run patch && npm publish --access public",
23
+ "dev": "nodemon --exec tsx src/test/index.ts"
24
+ },
25
+ "license": "MIT",
26
+ "dependencies": {
27
+ "@spatulox/discord-interaction-manager": "^1.0.17",
28
+ "discord.js": "^14.25.1"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^22.14.0",
32
+ "@types/node-schedule": "^2.1.7",
33
+ "dotenv": "^17.2.4",
34
+ "nodemon": "^3.1.9",
35
+ "tsup": "^8.5.1",
36
+ "tsx": "^4.20.3",
37
+ "typescript": "^5.9.3"
38
+ },
39
+ "keywords": [
40
+ "discord",
41
+ "framework",
42
+ "bot",
43
+ "client",
44
+ "discordjs",
45
+ "discord.js",
46
+ "node"
47
+ ],
48
+ "bugs": {
49
+ "url": "https://github.com/Spatulox/SimpleDiscordBot/issues"
50
+ }
51
+ }