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.
Files changed (58) hide show
  1. package/README.md +24 -65
  2. package/dist/bin/cli.js +1103 -104
  3. package/dist/cli/create/create.d.ts +2 -0
  4. package/dist/cli/create/create.d.ts.map +1 -0
  5. package/dist/cli/create/index.d.ts +2 -0
  6. package/dist/cli/create/index.d.ts.map +1 -0
  7. package/dist/cli/create/install.d.ts +3 -0
  8. package/dist/cli/create/install.d.ts.map +1 -0
  9. package/dist/cli/create/prompts.d.ts +6 -0
  10. package/dist/cli/create/prompts.d.ts.map +1 -0
  11. package/dist/cli/logger.d.ts +10 -0
  12. package/dist/cli/logger.d.ts.map +1 -0
  13. package/dist/cli/runner.d.ts +5 -0
  14. package/dist/cli/runner.d.ts.map +1 -0
  15. package/dist/cli/runtime.d.ts +4 -0
  16. package/dist/cli/runtime.d.ts.map +1 -0
  17. package/dist/cli/utils.d.ts +4 -0
  18. package/dist/cli/utils.d.ts.map +1 -0
  19. package/dist/commands/create/index.d.ts +4 -0
  20. package/dist/commands/create/index.d.ts.map +1 -0
  21. package/dist/commands/create/index.js +867 -0
  22. package/dist/commands/create/prompts.d.ts +46 -0
  23. package/dist/commands/create/prompts.d.ts.map +1 -0
  24. package/dist/commands/create/prompts.js +105 -0
  25. package/dist/commands/create/template.d.ts +23 -0
  26. package/dist/commands/create/template.d.ts.map +1 -0
  27. package/dist/commands/create/template.js +762 -0
  28. package/dist/commands/create/utils.d.ts +45 -0
  29. package/dist/commands/create/utils.d.ts.map +1 -0
  30. package/dist/commands/create/utils.js +119 -0
  31. package/dist/commands/create.command.d.ts +3 -0
  32. package/dist/commands/create.command.d.ts.map +1 -0
  33. package/dist/commands/dev.command.d.ts +3 -0
  34. package/dist/commands/dev.command.d.ts.map +1 -0
  35. package/dist/commands/start.command.d.ts +3 -0
  36. package/dist/commands/start.command.d.ts.map +1 -0
  37. package/dist/create/generator.d.ts +10 -0
  38. package/dist/create/generator.d.ts.map +1 -0
  39. package/dist/create/prompts.d.ts +8 -0
  40. package/dist/create/prompts.d.ts.map +1 -0
  41. package/dist/create/templates/bun-js/README.md +7 -0
  42. package/dist/create/templates/bun-js/src/commands/utils/ping.tpl +10 -0
  43. package/dist/create/templates/bun-js/src/events/ready.tpl +10 -0
  44. package/dist/create/templates/bun-js/src/index.tpl +11 -0
  45. package/dist/create/templates/bun-ts/README.md +7 -0
  46. package/dist/create/templates/bun-ts/src/commands/utils/ping.tpl +10 -0
  47. package/dist/create/templates/bun-ts/src/events/ready.tpl +10 -0
  48. package/dist/create/templates/bun-ts/src/index.tpl +11 -0
  49. package/dist/create/templates/node-js/README.md +7 -0
  50. package/dist/create/templates/node-js/src/commands/utils/ping.tpl +10 -0
  51. package/dist/create/templates/node-js/src/events/ready.tpl +10 -0
  52. package/dist/create/templates/node-js/src/index.tpl +11 -0
  53. package/dist/create/templates/node-ts/README.md +7 -0
  54. package/dist/create/templates/node-ts/src/commands/utils/ping.tpl +10 -0
  55. package/dist/create/templates/node-ts/src/events/ready.tpl +10 -0
  56. package/dist/create/templates/node-ts/src/index.tpl +11 -0
  57. package/package.json +11 -4
  58. 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
- ## ⚙️ Configuração
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
- `src/commands/util/ping.ts`
73
-
74
- ```ts
75
- const { createCommand, CommandType } = require('nexocord');
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
- ### 📡 Exemplo de evento
49
+ Esse fluxo já cria a base inicial do projeto para você começar sem montar estrutura manualmente.
88
50
 
89
- `src/events/ready.ts`
90
-
91
- ```ts
92
- const { createEvent } = require('nexocord');
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 sugerida
77
+ ## 📂 Estrutura criada pelo template
121
78
 
122
- ```txt
123
- src/
124
- commands/
125
- util/
126
- ping.ts
127
- events/
128
- ready.ts
129
- index.ts
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