@spatulox/simplediscordbot 3.0.1 → 3.0.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 +1 -1
- package/CHANGELOG.md +0 -0
- package/LICENSE.md +21 -21
- package/README.md +74 -65
- package/dist/index.d.mts +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
- package/prompt-message-for-wiki.txt +17 -17
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/CHANGELOG.md
CHANGED
|
File without changes
|
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,65 +1,74 @@
|
|
|
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, Buttons) that rely on discord.js for full compatibility
|
|
16
|
-
|
|
17
|
-
# Don't forget to check the [wiki](https://github.com/spatulox-discord/SimpleDiscordBot/wiki)
|
|
18
|
-
|
|
19
|
-
##
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
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, Buttons) that rely on discord.js for full compatibility
|
|
16
|
+
|
|
17
|
+
# Don't forget to check the [wiki](https://github.com/spatulox-discord/SimpleDiscordBot/wiki)
|
|
18
|
+
|
|
19
|
+
## 🧩 Starting a new bot ?
|
|
20
|
+
|
|
21
|
+
> Don't start from an empty folder : the [**DiscordBotTemplate**](https://github.com/Spatulox/DiscordBotTemplate)
|
|
22
|
+
> is a ready-to-use project built on this framework. Login, logging, modules, interaction
|
|
23
|
+
> routing and slash command deployment are already wired, you only fill in your ids.
|
|
24
|
+
>
|
|
25
|
+
> It has [its own wiki](https://github.com/Spatulox/DiscordBotTemplate/wiki) too, and a
|
|
26
|
+
> `feat/multi-bot` branch for several bots living in one repository.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
```bash
|
|
30
|
+
npm i @spatulox/simplediscordbot
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
Env Variables:
|
|
36
|
+
```
|
|
37
|
+
DISCORD_BOT_TOKEN="" // Your bot Token
|
|
38
|
+
```
|
|
39
|
+
<details>
|
|
40
|
+
<summary>Note for v2.1.2 and older</summary>
|
|
41
|
+
|
|
42
|
+
> You also need to set up this env var :
|
|
43
|
+
> ```
|
|
44
|
+
> DISCORD_BOT_CLIENTID="" // You bot ClientID
|
|
45
|
+
> ```
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import {Bot, BotConfig, SimpleColor, Time} from "@spatulox/simplediscordbot";
|
|
51
|
+
import {Client, Events, GatewayIntentBits} from "discord.js";
|
|
52
|
+
|
|
53
|
+
const client = new Client({
|
|
54
|
+
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const config: BotConfig = {
|
|
58
|
+
defaultSimpleColor: SimpleColor.blue,
|
|
59
|
+
botName: "Simple Discord Bot",
|
|
60
|
+
log: {
|
|
61
|
+
info: {channelId: "YOUR_LOG_CHANNEL_ID", console: true, discord: true},
|
|
62
|
+
error: {channelId: "YOUR_LOG_CHANNEL_ID", console: true, discord: true},
|
|
63
|
+
warn: {channelId: "YOUR_LOG_CHANNEL_ID", console: true, discord: true},
|
|
64
|
+
debug: {channelId: "YOUR_LOG_CHANNEL_ID", console: true, discord: false},
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const bot = new Bot(client, config);
|
|
69
|
+
|
|
70
|
+
bot.client.on(Events.ClientReady, async () => {
|
|
71
|
+
Bot.setRandomActivity(randomActivityList, Time.minute.MIN_10.toMilliseconds());
|
|
72
|
+
console.log("Bot ready! ✨");
|
|
73
|
+
});
|
|
74
|
+
```
|
package/dist/index.d.mts
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -763,7 +763,7 @@ var BotInteraction = class {
|
|
|
763
763
|
// package.json
|
|
764
764
|
var package_default = {
|
|
765
765
|
name: "@spatulox/simplediscordbot",
|
|
766
|
-
version: "3.0.
|
|
766
|
+
version: "3.0.2",
|
|
767
767
|
author: "Spatulox",
|
|
768
768
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
769
769
|
exports: {
|
|
@@ -785,7 +785,7 @@ var package_default = {
|
|
|
785
785
|
},
|
|
786
786
|
license: "MIT",
|
|
787
787
|
dependencies: {
|
|
788
|
-
"@spatulox/discord-interaction-manager": "^2.0.
|
|
788
|
+
"@spatulox/discord-interaction-manager": "^2.0.7",
|
|
789
789
|
"@spatulox/utils": "^0.2.0"
|
|
790
790
|
},
|
|
791
791
|
peerDependencies: {
|
|
@@ -2538,7 +2538,7 @@ var DiscordRegex = class {
|
|
|
2538
2538
|
// Caractères spéciaux
|
|
2539
2539
|
static SPACE = "\u200B";
|
|
2540
2540
|
// URLs basiques
|
|
2541
|
-
static URL_REGEX = /(https?:\/\/[
|
|
2541
|
+
static URL_REGEX = /(https?:\/\/[^\s<>]+)/i;
|
|
2542
2542
|
/* DISCORD REGEX */
|
|
2543
2543
|
static USER_REGEX = /<@\d{18}>/;
|
|
2544
2544
|
static BOT_REGEX = /<@\d{19}>/;
|
package/dist/index.mjs
CHANGED
|
@@ -743,7 +743,7 @@ var BotInteraction = class {
|
|
|
743
743
|
// package.json
|
|
744
744
|
var package_default = {
|
|
745
745
|
name: "@spatulox/simplediscordbot",
|
|
746
|
-
version: "3.0.
|
|
746
|
+
version: "3.0.2",
|
|
747
747
|
author: "Spatulox",
|
|
748
748
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
749
749
|
exports: {
|
|
@@ -765,7 +765,7 @@ var package_default = {
|
|
|
765
765
|
},
|
|
766
766
|
license: "MIT",
|
|
767
767
|
dependencies: {
|
|
768
|
-
"@spatulox/discord-interaction-manager": "^2.0.
|
|
768
|
+
"@spatulox/discord-interaction-manager": "^2.0.7",
|
|
769
769
|
"@spatulox/utils": "^0.2.0"
|
|
770
770
|
},
|
|
771
771
|
peerDependencies: {
|
|
@@ -2546,7 +2546,7 @@ var DiscordRegex = class {
|
|
|
2546
2546
|
// Caractères spéciaux
|
|
2547
2547
|
static SPACE = "\u200B";
|
|
2548
2548
|
// URLs basiques
|
|
2549
|
-
static URL_REGEX = /(https?:\/\/[
|
|
2549
|
+
static URL_REGEX = /(https?:\/\/[^\s<>]+)/i;
|
|
2550
2550
|
/* DISCORD REGEX */
|
|
2551
2551
|
static USER_REGEX = /<@\d{18}>/;
|
|
2552
2552
|
static BOT_REGEX = /<@\d{19}>/;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spatulox/simplediscordbot",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"author": "Spatulox",
|
|
5
5
|
"description": "Simple discord bot framework to set up a bot under 30 secondes",
|
|
6
6
|
"exports": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@spatulox/discord-interaction-manager": "^2.0.
|
|
25
|
+
"@spatulox/discord-interaction-manager": "^2.0.7",
|
|
26
26
|
"@spatulox/utils": "^0.2.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
Rédige une page de wiki au format suivant :
|
|
2
|
-
|
|
3
|
-
- Utilise le langage Markdown.
|
|
4
|
-
- Commence par un en‑tête `## [NomDeLaClasse / NomDuModule]`.
|
|
5
|
-
- Ajoute un bref paragraphe introductif qui explique en 1–2 phrases ce que cette classe / ce module fait.
|
|
6
|
-
- Ensuite, utilise des sous‑titres courtes (au maximum 6 mots) comme :
|
|
7
|
-
- `### Core behavior`
|
|
8
|
-
- `### Main methods`
|
|
9
|
-
- `### Exemple d’utilisation`
|
|
10
|
-
- `### Typique usage`
|
|
11
|
-
- Pour chaque section, rédige 2–3 phrases max, claires et concises.
|
|
12
|
-
- Évite les résumés / conclusions à la fin; limite le contenu exactement aux sections utiles.
|
|
13
|
-
- Si la classe est un helper ou un utils, explique aussi comment l’utilisateur doit l’instancier / l’utiliser dans son code.
|
|
14
|
-
- Si la classe fait partie d’un système plus large (ex. module system, manager, interaction router), place un petit paragraphe qui montre où elle s’insère dans l’architecture globale.
|
|
15
|
-
- Ne fais pas de liste de toutes les méthodes une par une; regroupe‑les par rôle ou par type (ex. “methods for reading files”, “methods for sending messages”).
|
|
16
|
-
- Termine par une petite section `### Typical usage` avec 1–2 exemples de code courts et concrets en TypeScript, montrant comment l’utiliser dans un contexte de bot Discord.
|
|
17
|
-
|
|
1
|
+
Rédige une page de wiki en anglais au format suivant :
|
|
2
|
+
|
|
3
|
+
- Utilise le langage Markdown.
|
|
4
|
+
- Commence par un en‑tête `## [NomDeLaClasse / NomDuModule]`.
|
|
5
|
+
- Ajoute un bref paragraphe introductif qui explique en 1–2 phrases ce que cette classe / ce module fait.
|
|
6
|
+
- Ensuite, utilise des sous‑titres courtes (au maximum 6 mots) comme :
|
|
7
|
+
- `### Core behavior`
|
|
8
|
+
- `### Main methods`
|
|
9
|
+
- `### Exemple d’utilisation`
|
|
10
|
+
- `### Typique usage`
|
|
11
|
+
- Pour chaque section, rédige 2–3 phrases max, claires et concises.
|
|
12
|
+
- Évite les résumés / conclusions à la fin; limite le contenu exactement aux sections utiles.
|
|
13
|
+
- Si la classe est un helper ou un utils, explique aussi comment l’utilisateur doit l’instancier / l’utiliser dans son code.
|
|
14
|
+
- Si la classe fait partie d’un système plus large (ex. module system, manager, interaction router), place un petit paragraphe qui montre où elle s’insère dans l’architecture globale.
|
|
15
|
+
- Ne fais pas de liste de toutes les méthodes une par une; regroupe‑les par rôle ou par type (ex. “methods for reading files”, “methods for sending messages”).
|
|
16
|
+
- Termine par une petite section `### Typical usage` avec 1–2 exemples de code courts et concrets en TypeScript, montrant comment l’utiliser dans un contexte de bot Discord.
|
|
17
|
+
|
|
18
18
|
Tout doit rester lisible, orienté développeur, sans entrer dans des détails implémentatoires trop bas‑niveau.
|