create-djskit 0.0.0-stage → 1.0.0
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 +45 -2
- package/dist/index.js +207 -0
- package/dist/scaffold.js +137 -0
- package/package.json +46 -4
- package/template/.env.example +4 -0
- package/template/.gitattributes +2 -0
- package/template/_package.json +32 -0
- package/template/gitignore +5 -0
- package/template/src/commands/TestMessage/test-dollar.ts +17 -0
- package/template/src/commands/TestMessage/test.ts +16 -0
- package/template/src/commands/TestSlash/autocomplete.ts +60 -0
- package/template/src/commands/TestSlash/button.ts +22 -0
- package/template/src/commands/TestSlash/test.ts +15 -0
- package/template/src/components/buttons/testButton.ts +11 -0
- package/template/src/config.ts +10 -0
- package/template/src/context/Message/quote.ts +17 -0
- package/template/src/context/User/avatar.ts +17 -0
- package/template/src/events/Guild/msgCreate.ts +16 -0
- package/template/src/handler/database.ts +9 -0
- package/template/src/handler/devMode.ts +17 -0
- package/template/src/handler/eventHandler.ts +49 -0
- package/template/src/handler/listenerComponents.ts +62 -0
- package/template/src/handler/listenerMsgCommands.ts +74 -0
- package/template/src/handler/listenerSlashCommands.ts +89 -0
- package/template/src/handler/registerComponents.ts +50 -0
- package/template/src/handler/registerMsgCommands.ts +62 -0
- package/template/src/handler/registerSlashCommands.ts +148 -0
- package/template/src/index.ts +105 -0
- package/template/start.sh +2 -0
- package/template/tsconfig.json +31 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// @src/index.ts -> Main entry point -----------------------------------------------
|
|
2
|
+
//
|
|
3
|
+
// ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
|
|
4
|
+
// DJSKit: Made by @NZ-Linix on GitHub
|
|
5
|
+
// ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
|
|
6
|
+
//
|
|
7
|
+
// ---------------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
// Imports -------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
import "dotenv/config";
|
|
12
|
+
import {
|
|
13
|
+
Client,
|
|
14
|
+
Partials,
|
|
15
|
+
Events,
|
|
16
|
+
ActivityType
|
|
17
|
+
} from "discord.js";
|
|
18
|
+
|
|
19
|
+
// Load console colors -------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
import chalk from "chalk";
|
|
22
|
+
import config from "./config";
|
|
23
|
+
|
|
24
|
+
// Create client -------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
const client = new Client({
|
|
27
|
+
intents: 53608447,
|
|
28
|
+
partials: [
|
|
29
|
+
Partials.User,
|
|
30
|
+
Partials.ThreadMember,
|
|
31
|
+
Partials.SoundboardSound,
|
|
32
|
+
Partials.Reaction,
|
|
33
|
+
Partials.Message,
|
|
34
|
+
Partials.GuildScheduledEvent,
|
|
35
|
+
Partials.GuildMember,
|
|
36
|
+
Partials.Channel,
|
|
37
|
+
Partials.Poll,
|
|
38
|
+
Partials.PollAnswer
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
console.log()
|
|
43
|
+
|
|
44
|
+
// Ready event ---------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
client.once(Events.ClientReady, async () => {
|
|
47
|
+
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
console.log(chalk.green.bold("[🌿]") + " " + "Application is ready.");
|
|
50
|
+
console.log("")
|
|
51
|
+
}, 10);
|
|
52
|
+
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Status rotations ----------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
if ( config.status.rotations.length > 0 ) {
|
|
58
|
+
|
|
59
|
+
let i = 0;
|
|
60
|
+
|
|
61
|
+
setInterval(() => {
|
|
62
|
+
|
|
63
|
+
if ( i >= config.status.rotations.length ) {
|
|
64
|
+
i = 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
client.user?.setPresence({ activities: [{ name: config.status.rotations[i], type: ActivityType.Custom }], status: "online" });
|
|
68
|
+
|
|
69
|
+
i++;
|
|
70
|
+
|
|
71
|
+
}, 5 * 1000);
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Execute listener and handlers ---------------------------------------------------
|
|
76
|
+
|
|
77
|
+
import handlerRegisterSlashCommands from "./handler/registerSlashCommands";
|
|
78
|
+
handlerRegisterSlashCommands(client);
|
|
79
|
+
|
|
80
|
+
import handlerRegisterMsgCommands from "./handler/registerMsgCommands";
|
|
81
|
+
handlerRegisterMsgCommands(client);
|
|
82
|
+
|
|
83
|
+
import handlerRegisterComponents from "./handler/registerComponents";
|
|
84
|
+
handlerRegisterComponents(client);
|
|
85
|
+
|
|
86
|
+
import eventHandler from "./handler/eventHandler";
|
|
87
|
+
eventHandler(client);
|
|
88
|
+
|
|
89
|
+
// Login to Discord ----------------------------------------------------------------
|
|
90
|
+
|
|
91
|
+
client.login(process.env.CLIENT_TOKEN).then(() => {
|
|
92
|
+
|
|
93
|
+
console.log(chalk.green.bold("[🌿]") + " " + "Logged in as " + chalk.green.bold(client.user?.username) + ".");
|
|
94
|
+
|
|
95
|
+
}).catch((err) => {
|
|
96
|
+
|
|
97
|
+
console.log(chalk.red.bold("[❌]") + " " + chalk.red("Failed to login."));
|
|
98
|
+
console.log()
|
|
99
|
+
console.log(chalk.grey("------------------------------"))
|
|
100
|
+
console.log()
|
|
101
|
+
console.log(err);
|
|
102
|
+
console.log()
|
|
103
|
+
console.log(chalk.grey("------------------------------"))
|
|
104
|
+
|
|
105
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// File Layout
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"noEmit": true, // tsx runs the source directly
|
|
7
|
+
|
|
8
|
+
// Environment Settings
|
|
9
|
+
"module": "nodenext",
|
|
10
|
+
"target": "es2024",
|
|
11
|
+
"lib": ["es2024"],
|
|
12
|
+
"types": ["node"],
|
|
13
|
+
|
|
14
|
+
// Style Options
|
|
15
|
+
// "noImplicitReturns": true,
|
|
16
|
+
// "noImplicitOverride": true,
|
|
17
|
+
// "noUnusedLocals": true,
|
|
18
|
+
// "noUnusedParameters": true,
|
|
19
|
+
// "noFallthroughCasesInSwitch": true,
|
|
20
|
+
// "noUncheckedIndexedAccess": true,
|
|
21
|
+
|
|
22
|
+
// Recommended Options
|
|
23
|
+
"strict": true,
|
|
24
|
+
"isolatedModules": true,
|
|
25
|
+
"noUncheckedSideEffectImports": true,
|
|
26
|
+
"moduleDetection": "force",
|
|
27
|
+
"forceConsistentCasingInFileNames": true,
|
|
28
|
+
"skipLibCheck": true
|
|
29
|
+
},
|
|
30
|
+
"include": ["src"]
|
|
31
|
+
}
|