nexocord 1.0.6 → 1.1.1
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 +24 -65
- package/dist/bin/cli.js +1103 -104
- package/dist/cli/create/create.d.ts +2 -0
- package/dist/cli/create/create.d.ts.map +1 -0
- package/dist/cli/create/index.d.ts +2 -0
- package/dist/cli/create/index.d.ts.map +1 -0
- package/dist/cli/create/install.d.ts +3 -0
- package/dist/cli/create/install.d.ts.map +1 -0
- package/dist/cli/create/prompts.d.ts +6 -0
- package/dist/cli/create/prompts.d.ts.map +1 -0
- package/dist/cli/logger.d.ts +10 -0
- package/dist/cli/logger.d.ts.map +1 -0
- package/dist/cli/runner.d.ts +5 -0
- package/dist/cli/runner.d.ts.map +1 -0
- package/dist/cli/runtime.d.ts +4 -0
- package/dist/cli/runtime.d.ts.map +1 -0
- package/dist/cli/utils.d.ts +4 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/commands/create/index.d.ts +4 -0
- package/dist/commands/create/index.d.ts.map +1 -0
- package/dist/commands/create/index.js +867 -0
- package/dist/commands/create/prompts.d.ts +46 -0
- package/dist/commands/create/prompts.d.ts.map +1 -0
- package/dist/commands/create/prompts.js +105 -0
- package/dist/commands/create/template.d.ts +23 -0
- package/dist/commands/create/template.d.ts.map +1 -0
- package/dist/commands/create/template.js +762 -0
- package/dist/commands/create/utils.d.ts +45 -0
- package/dist/commands/create/utils.d.ts.map +1 -0
- package/dist/commands/create/utils.js +119 -0
- package/dist/commands/create.command.d.ts +3 -0
- package/dist/commands/create.command.d.ts.map +1 -0
- package/dist/commands/dev.command.d.ts +3 -0
- package/dist/commands/dev.command.d.ts.map +1 -0
- package/dist/commands/start.command.d.ts +3 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/create/generator.d.ts +10 -0
- package/dist/create/generator.d.ts.map +1 -0
- package/dist/create/prompts.d.ts +8 -0
- package/dist/create/prompts.d.ts.map +1 -0
- package/dist/create/templates/bun-js/README.md +7 -0
- package/dist/create/templates/bun-js/src/commands/utils/ping.tpl +10 -0
- package/dist/create/templates/bun-js/src/events/ready.tpl +10 -0
- package/dist/create/templates/bun-js/src/index.tpl +11 -0
- package/dist/create/templates/bun-ts/README.md +7 -0
- package/dist/create/templates/bun-ts/src/commands/utils/ping.tpl +10 -0
- package/dist/create/templates/bun-ts/src/events/ready.tpl +10 -0
- package/dist/create/templates/bun-ts/src/index.tpl +11 -0
- package/dist/create/templates/node-js/README.md +7 -0
- package/dist/create/templates/node-js/src/commands/utils/ping.tpl +10 -0
- package/dist/create/templates/node-js/src/events/ready.tpl +10 -0
- package/dist/create/templates/node-js/src/index.tpl +11 -0
- package/dist/create/templates/node-ts/README.md +7 -0
- package/dist/create/templates/node-ts/src/commands/utils/ping.tpl +10 -0
- package/dist/create/templates/node-ts/src/events/ready.tpl +10 -0
- package/dist/create/templates/node-ts/src/index.tpl +11 -0
- package/package.json +11 -4
- package/tsconfig.json +0 -31
package/README.md
CHANGED
|
@@ -38,72 +38,29 @@ O Nexocord resolve isso oferecendo:
|
|
|
38
38
|
npm install nexocord discord.js
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
##
|
|
42
|
-
Crie um arquivo .env:
|
|
43
|
-
```txt
|
|
44
|
-
TOKEN=seu_token_aqui
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## ⚡ Início rápido (JavaScript)
|
|
48
|
-
|
|
49
|
-
Crie um arquivo de entrada (exemplo: `src/index.js`):
|
|
50
|
-
|
|
51
|
-
```js
|
|
52
|
-
const { Bootstrap } = require('nexocord');
|
|
53
|
-
const { GatewayIntentBits } = require('discord.js');
|
|
54
|
-
|
|
55
|
-
async function main() {
|
|
56
|
-
await Bootstrap.init({
|
|
57
|
-
token: process.env.TOKEN,
|
|
58
|
-
intents: [GatewayIntentBits.Guilds],
|
|
59
|
-
paths: {
|
|
60
|
-
commands: 'src/commands',
|
|
61
|
-
events: 'src/events',
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
main()
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### 📝 Exemplo de comando
|
|
41
|
+
## ⚡ Primeiro bot com CLI
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
module.exports = createCommand({
|
|
78
|
-
name: 'ping',
|
|
79
|
-
description: 'Responde com pong!',
|
|
80
|
-
type: CommandType.ChatInput,
|
|
81
|
-
async run(interaction) {
|
|
82
|
-
await interaction.reply({ content: 'Pong!' });
|
|
83
|
-
},
|
|
84
|
-
});
|
|
43
|
+
```bash
|
|
44
|
+
npx nexo create meu-bot
|
|
45
|
+
cd meu-bot
|
|
46
|
+
npx nexo dev
|
|
85
47
|
```
|
|
86
48
|
|
|
87
|
-
|
|
49
|
+
Esse fluxo já cria a base inicial do projeto para você começar sem montar estrutura manualmente.
|
|
88
50
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
module.exports = createEvent({
|
|
95
|
-
name: 'ready',
|
|
96
|
-
once: true,
|
|
97
|
-
run(client) {
|
|
98
|
-
console.log(`Bot ${client.user?.username} está online!`);
|
|
99
|
-
},
|
|
100
|
-
});
|
|
51
|
+
## ⚙️ Configuração
|
|
52
|
+
Crie um arquivo .env:
|
|
53
|
+
```txt
|
|
54
|
+
TOKEN=seu_token_aqui
|
|
101
55
|
```
|
|
102
56
|
|
|
103
57
|
## 🧰 CLI
|
|
104
58
|
O Nexocord inclui uma CLI própria.
|
|
105
59
|
|
|
106
60
|
```bash
|
|
61
|
+
# criar projeto
|
|
62
|
+
npx nexo create meu-bot
|
|
63
|
+
|
|
107
64
|
# desenvolvimento
|
|
108
65
|
npx nexo dev
|
|
109
66
|
|
|
@@ -117,16 +74,18 @@ npx nexo dev --watch
|
|
|
117
74
|
npx nexo start dist/bot.js
|
|
118
75
|
```
|
|
119
76
|
|
|
120
|
-
## 📂 Estrutura
|
|
77
|
+
## 📂 Estrutura criada pelo template
|
|
121
78
|
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
79
|
+
```
|
|
80
|
+
📂 meu-bot/
|
|
81
|
+
┣ 📂 src/
|
|
82
|
+
┃ ┣ 📂 commands/
|
|
83
|
+
┃ ┃ ┗ 📂 utils/
|
|
84
|
+
┃ ┃ ┗ 📜 ping.ts
|
|
85
|
+
┃ ┣ 📂 events/
|
|
86
|
+
┃ ┃ ┗ 📜 ready.ts
|
|
87
|
+
┃ ┗ 📜 index.ts
|
|
88
|
+
┗ 📜 package.json
|
|
130
89
|
```
|
|
131
90
|
|
|
132
91
|
## 🚧 Status do projeto
|