@spatulox/simplediscordbot 1.0.38 → 1.0.40
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 +1 -1
- package/LICENSE.md +21 -21
- package/README.md +58 -51
- package/dist/index.js +3 -7
- package/dist/index.mjs +3 -7
- package/package.json +51 -51
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,58 @@
|
|
|
1
|
-
|
|
2
|
-
# Simple Discord Bot 
|
|
3
|
-
|
|
4
|
-
[](https://npmjs.com/package/@spatulox/simplediscordbot)
|
|
5
|
-
[](https://npmjs.com/package/@spatulox/simplediscordbot)
|
|
6
|
-
[](LICENSE)
|
|
7
|
-
|
|
8
|
-
**
|
|
9
|
-
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
1
|
+
|
|
2
|
+
# Simple Discord Bot 
|
|
3
|
+
|
|
4
|
+
[](https://npmjs.com/package/@spatulox/simplediscordbot)
|
|
5
|
+
[](https://npmjs.com/package/@spatulox/simplediscordbot)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
> **TypeScript Discord.js framework** - Simple, powerful, framework-ready. Built for developers who want clean bot architecture.
|
|
9
|
+
|
|
10
|
+
## ✨ Features :
|
|
11
|
+
> - Fully compatible with discordjs
|
|
12
|
+
> - Include the [DiscordInterationManager](https://github.com/Spatulox/DiscordInteractionManager) package
|
|
13
|
+
> - Simple Log package
|
|
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
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
```bash
|
|
20
|
+
npm i @spatulox/simplediscordbot
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
Env Variables:
|
|
26
|
+
```bash
|
|
27
|
+
DISCORD_BOT_TOKEN="" // Your bot Token
|
|
28
|
+
DISCORD_BOT_CLIENTID="" // Yout bot client id
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import {Bot, BotConfig, EmbedColor, Time} from "@spatulox/simplediscordbot";
|
|
33
|
+
import {Client, Events, GatewayIntentBits} from "discord.js";
|
|
34
|
+
|
|
35
|
+
const client = new Client({
|
|
36
|
+
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const config: BotConfig = {
|
|
40
|
+
defaultEmbedColor: EmbedColor.blue,
|
|
41
|
+
botName: "Simple Discord Bot",
|
|
42
|
+
log: {
|
|
43
|
+
logChannelId: "YOUR_LOG_CHANNEL_ID",
|
|
44
|
+
errorChannelId: "YOUR_ERROR_CHANNEL_ID",
|
|
45
|
+
info: { console: true, discord: true },
|
|
46
|
+
error: { console: true, discord: true },
|
|
47
|
+
warn: { console: true, discord: true },
|
|
48
|
+
debug: { console: true, discord: false }
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const bot = new Bot(client, config);
|
|
53
|
+
|
|
54
|
+
bot.client.on(Events.ClientReady, async () => {
|
|
55
|
+
Bot.setRandomActivity(randomActivityList, Time.minute.MIN_10.toMilliseconds());
|
|
56
|
+
console.log("Bot ready! ✨");
|
|
57
|
+
});
|
|
58
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -641,16 +641,12 @@ var SendableComponentBuilder = class {
|
|
|
641
641
|
}
|
|
642
642
|
return base;
|
|
643
643
|
}
|
|
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
644
|
static buildInteraction(content, component, ephemeral) {
|
|
648
645
|
let base = {};
|
|
649
646
|
this.build(base, content, component);
|
|
650
|
-
if (ephemeral
|
|
647
|
+
if (ephemeral) {
|
|
651
648
|
base.flags = [import_discord3.MessageFlags.Ephemeral];
|
|
652
649
|
}
|
|
653
|
-
console.log(base);
|
|
654
650
|
return base;
|
|
655
651
|
}
|
|
656
652
|
static buildMessage(contentOrComponent, component) {
|
|
@@ -2528,7 +2524,7 @@ var SimpleMutex = class {
|
|
|
2528
2524
|
// package.json
|
|
2529
2525
|
var package_default = {
|
|
2530
2526
|
name: "@spatulox/simplediscordbot",
|
|
2531
|
-
version: "1.0.
|
|
2527
|
+
version: "1.0.39",
|
|
2532
2528
|
author: "Spatulox",
|
|
2533
2529
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
2534
2530
|
exports: {
|
|
@@ -2552,7 +2548,7 @@ var package_default = {
|
|
|
2552
2548
|
},
|
|
2553
2549
|
license: "MIT",
|
|
2554
2550
|
dependencies: {
|
|
2555
|
-
"@spatulox/discord-interaction-manager": "^1.0.
|
|
2551
|
+
"@spatulox/discord-interaction-manager": "^1.0.18",
|
|
2556
2552
|
"discord.js": "^14.25.1"
|
|
2557
2553
|
},
|
|
2558
2554
|
devDependencies: {
|
package/dist/index.mjs
CHANGED
|
@@ -600,16 +600,12 @@ var SendableComponentBuilder = class {
|
|
|
600
600
|
}
|
|
601
601
|
return base;
|
|
602
602
|
}
|
|
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
603
|
static buildInteraction(content, component, ephemeral) {
|
|
607
604
|
let base = {};
|
|
608
605
|
this.build(base, content, component);
|
|
609
|
-
if (ephemeral
|
|
606
|
+
if (ephemeral) {
|
|
610
607
|
base.flags = [MessageFlags2.Ephemeral];
|
|
611
608
|
}
|
|
612
|
-
console.log(base);
|
|
613
609
|
return base;
|
|
614
610
|
}
|
|
615
611
|
static buildMessage(contentOrComponent, component) {
|
|
@@ -2506,7 +2502,7 @@ var SimpleMutex = class {
|
|
|
2506
2502
|
// package.json
|
|
2507
2503
|
var package_default = {
|
|
2508
2504
|
name: "@spatulox/simplediscordbot",
|
|
2509
|
-
version: "1.0.
|
|
2505
|
+
version: "1.0.39",
|
|
2510
2506
|
author: "Spatulox",
|
|
2511
2507
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
2512
2508
|
exports: {
|
|
@@ -2530,7 +2526,7 @@ var package_default = {
|
|
|
2530
2526
|
},
|
|
2531
2527
|
license: "MIT",
|
|
2532
2528
|
dependencies: {
|
|
2533
|
-
"@spatulox/discord-interaction-manager": "^1.0.
|
|
2529
|
+
"@spatulox/discord-interaction-manager": "^1.0.18",
|
|
2534
2530
|
"discord.js": "^14.25.1"
|
|
2535
2531
|
},
|
|
2536
2532
|
devDependencies: {
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@spatulox/simplediscordbot",
|
|
3
|
-
"version": "1.0.
|
|
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.
|
|
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.40",
|
|
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.18",
|
|
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
|
+
}
|