nexocord 1.0.5 → 1.1.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 +24 -69
- 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/core/creators.d.ts.map +1 -1
- package/dist/core/modules/commands/handler.d.ts.map +1 -1
- package/dist/core/modules/events/handler.d.ts.map +1 -1
- package/dist/core/types/index.js +57456 -0
- package/dist/core/ui/index.js +57899 -0
- package/dist/core/utils/Responder.d.ts +1 -1
- package/dist/core/utils/Responder.d.ts.map +1 -1
- package/dist/core/utils/extensions.d.ts +4 -0
- package/dist/core/utils/extensions.d.ts.map +1 -0
- package/dist/core/utils/index.d.ts +0 -1
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/core/utils/index.js +598 -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/dist/index.cjs +88 -80
- package/dist/index.js +841 -832
- package/package.json +10 -9
- package/tsconfig.json +0 -31
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Nexocord
|
|
2
|
-

|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
4
6
|
|
|
5
7
|
Nexocord é um framework para criação de bots Discord modernos usando TypeScript ou JavaScript, focado em organização, produtividade e escalabilidade desde o primeiro arquivo.
|
|
6
8
|
|
|
@@ -36,78 +38,29 @@ O Nexocord resolve isso oferecendo:
|
|
|
36
38
|
npm install nexocord discord.js
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
## ⚡ Primeiro bot com CLI
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
|
-
|
|
44
|
+
npx nexo create meu-bot
|
|
45
|
+
cd meu-bot
|
|
46
|
+
npx nexo dev
|
|
43
47
|
```
|
|
44
48
|
|
|
49
|
+
Esse fluxo já cria a base inicial do projeto para você começar sem montar estrutura manualmente.
|
|
50
|
+
|
|
45
51
|
## ⚙️ Configuração
|
|
46
52
|
Crie um arquivo .env:
|
|
47
53
|
```txt
|
|
48
54
|
TOKEN=seu_token_aqui
|
|
49
55
|
```
|
|
50
56
|
|
|
51
|
-
## ⚡ Início rápido (JavaScript)
|
|
52
|
-
|
|
53
|
-
Crie um arquivo de entrada (exemplo: `src/index.js`):
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
const { Bootstrap } = require('nexocord');
|
|
57
|
-
const { GatewayIntentBits } = require('discord.js');
|
|
58
|
-
|
|
59
|
-
async function main() {
|
|
60
|
-
await Bootstrap.init({
|
|
61
|
-
token: process.env.TOKEN,
|
|
62
|
-
intents: [GatewayIntentBits.Guilds],
|
|
63
|
-
paths: {
|
|
64
|
-
commands: 'src/commands',
|
|
65
|
-
events: 'src/events',
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
main()
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### 📝 Exemplo de comando
|
|
75
|
-
|
|
76
|
-
`src/commands/util/ping.ts`
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
const { createCommand, CommandType } = require('nexocord');
|
|
80
|
-
|
|
81
|
-
module.exports = createCommand({
|
|
82
|
-
name: 'ping',
|
|
83
|
-
description: 'Responde com pong!',
|
|
84
|
-
type: CommandType.ChatInput,
|
|
85
|
-
async run(interaction) {
|
|
86
|
-
await interaction.reply({ content: 'Pong!' });
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### 📡 Exemplo de evento
|
|
92
|
-
|
|
93
|
-
`src/events/ready.ts`
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
const { createEvent } = require('nexocord');
|
|
97
|
-
|
|
98
|
-
module.exports = createEvent({
|
|
99
|
-
name: 'ready',
|
|
100
|
-
once: true,
|
|
101
|
-
run(client) {
|
|
102
|
-
console.log(`Bot ${client.user?.username} está online!`);
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
```
|
|
106
|
-
|
|
107
57
|
## 🧰 CLI
|
|
108
58
|
O Nexocord inclui uma CLI própria.
|
|
109
59
|
|
|
110
60
|
```bash
|
|
61
|
+
# criar projeto
|
|
62
|
+
npx nexo create meu-bot
|
|
63
|
+
|
|
111
64
|
# desenvolvimento
|
|
112
65
|
npx nexo dev
|
|
113
66
|
|
|
@@ -121,16 +74,18 @@ npx nexo dev --watch
|
|
|
121
74
|
npx nexo start dist/bot.js
|
|
122
75
|
```
|
|
123
76
|
|
|
124
|
-
## 📂 Estrutura
|
|
77
|
+
## 📂 Estrutura criada pelo template
|
|
125
78
|
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
79
|
+
```
|
|
80
|
+
📂 meu-bot/
|
|
81
|
+
┣ 📂 src/
|
|
82
|
+
┃ ┣ 📂 commands/
|
|
83
|
+
┃ ┃ ┗ 📂 utils/
|
|
84
|
+
┃ ┃ ┗ 📜 ping.ts
|
|
85
|
+
┃ ┣ 📂 events/
|
|
86
|
+
┃ ┃ ┗ 📜 ready.ts
|
|
87
|
+
┃ ┗ 📜 index.ts
|
|
88
|
+
┗ 📜 package.json
|
|
134
89
|
```
|
|
135
90
|
|
|
136
91
|
## 🚧 Status do projeto
|