djs-builder 0.6.0 → 0.6.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.
- package/README.md +43 -58
- package/handler/starter.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,67 +29,52 @@ Starter provides functionality for initializing and starting a Discord bot 🤖.
|
|
|
29
29
|
<summary>Starter ⚙️</summary>
|
|
30
30
|
|
|
31
31
|
```js
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
path: './path/to/slash_commands', // Required: Path to slash commands
|
|
75
|
-
log : "" // id of log channel
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
prefix: {
|
|
79
|
-
path: './path/to/prefixes', // Required: Path to prefix settings
|
|
80
|
-
prefix: '!', // Required: Default bot prefix
|
|
81
|
-
log : "" // id of log channel
|
|
82
|
-
},
|
|
83
|
-
events: {
|
|
84
|
-
path: './path/to/events', // Required: Path to event handlers
|
|
85
|
-
},
|
|
86
|
-
anticrash: {
|
|
87
|
-
url: 'https://your.crash.webhook.url', // Required: Webhook URL for crash alerts
|
|
88
|
-
mention_id: "YOUR_USER_ID" // [OPTIONAL] User ID to mention in crash alerts
|
|
89
|
-
}
|
|
32
|
+
const { starter } = require("djs-builder");
|
|
33
|
+
|
|
34
|
+
const { Client, GatewayIntentBits } = require("discord.js");
|
|
35
|
+
const client = new Client({
|
|
36
|
+
intents: Object.keys(GatewayIntentBits).map((a) => {
|
|
37
|
+
return GatewayIntentBits[a];
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Define starter options
|
|
42
|
+
const starterOptions = {
|
|
43
|
+
bot: {
|
|
44
|
+
token: "YOUR_BOT_TOKEN", // [OPTIONAL] Discord bot token
|
|
45
|
+
ownerId: "YOUR_USER_ID",
|
|
46
|
+
},
|
|
47
|
+
terminal: true,
|
|
48
|
+
Status: {
|
|
49
|
+
status: "online", // Required: Bot presence state ['online', 'offline', 'dnd', 'idle', 'Streaming']
|
|
50
|
+
activities: ["Game 1", "Game 2"], // [OPTIONAL] Bot activities
|
|
51
|
+
type: 0, // [OPTIONAL] Bot activity type
|
|
52
|
+
time: 60000, // [OPTIONAL] Activity rotation delay in milliseconds
|
|
53
|
+
},
|
|
54
|
+
database: {
|
|
55
|
+
url: "mongodb://localhost:27017", // Required: MongoDB connection URI
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
slash: {
|
|
59
|
+
path: "./path/to/slash_commands", // Required: Path to slash commands
|
|
60
|
+
log: "", // id of log channel
|
|
61
|
+
},
|
|
62
|
+
prefix: {
|
|
63
|
+
path: "./path/to/prefixes", // Required: Path to prefix settings
|
|
64
|
+
prefix: "!", // Required: Default bot prefix
|
|
65
|
+
log: "", // id of log channel
|
|
66
|
+
},
|
|
67
|
+
events: {
|
|
68
|
+
path: "./path/to/events", // Required: Path to event handlers
|
|
69
|
+
},
|
|
70
|
+
anticrash: {
|
|
71
|
+
url: "https://your.crash.webhook.url", // Required: Webhook URL for crash alerts
|
|
72
|
+
mention_id: "YOUR_USER_ID", // [OPTIONAL] User ID to mention in crash alerts
|
|
73
|
+
},
|
|
90
74
|
};
|
|
91
75
|
|
|
92
76
|
await starter(client, starterOptions);
|
|
77
|
+
|
|
93
78
|
```
|
|
94
79
|
|
|
95
80
|
</details>
|
package/handler/starter.js
CHANGED
|
@@ -146,7 +146,7 @@ async function starter(client, options) {
|
|
|
146
146
|
//////////////////////////////////////////* prefix run !////////////////////////////////////////////////////////
|
|
147
147
|
|
|
148
148
|
client.on("messageCreate", async (message) => {
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
if (message.author.bot) return;
|
|
151
151
|
|
|
152
152
|
const content = message.content.trim();
|