diracord 0.0.0-stage → 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 lexersonly
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,147 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="https://diracord.vercel.app/banner.svg" alt="Diracord: bots de Discord em texto simples" width="100%">
4
+
5
+ <br><br>
6
+
7
+ **Uma linguagem de texto para criar bots de Discord.**<br>
8
+ Mais fácil que aoi.js, com erros que dizem exatamente o que corrigir.
9
+
10
+ <br>
11
+
12
+ [![npm](https://img.shields.io/npm/v/diracord?style=flat-square&color=black&label=npm)](https://www.npmjs.com/package/diracord)
13
+ [![node](https://img.shields.io/node/v/diracord?style=flat-square&color=black)](https://nodejs.org)
14
+ [![licença MIT](https://img.shields.io/badge/licen%C3%A7a-MIT-black?style=flat-square)](https://github.com/lexersonly/diracord/blob/claude/keen-johnson-qfd683/LICENSE)
15
+ [![motor em Rust](https://img.shields.io/badge/motor-Rust-black?style=flat-square&logo=rust)](https://github.com/lexersonly/diracord)
16
+ [![RAM do motor](https://img.shields.io/badge/RAM_do_motor-~2.5_MB-black?style=flat-square)](https://github.com/lexersonly/diracord)
17
+
18
+ [**Site**](https://diracord.vercel.app) &nbsp;·&nbsp; [**Começar**](https://diracord.vercel.app/docs/getting-started) &nbsp;·&nbsp; [**Dicas e comandos**](https://diracord.vercel.app/docs/tips) &nbsp;·&nbsp; [**Vindo do aoi.js**](https://diracord.vercel.app/docs/from-aoijs) &nbsp;·&nbsp; [**GitHub**](https://github.com/lexersonly/diracord)
19
+
20
+ </div>
21
+
22
+ ## ✨ Em 10 segundos
23
+
24
+ ```dcs
25
+ command("ban", user: member, reason: text = "no reason") {
26
+ testing {
27
+ ban user reason
28
+ reply "$user.name was banned. Reason: $reason"
29
+ } catch err {
30
+ reply "Could not ban: $err"
31
+ }
32
+ }
33
+ ```
34
+
35
+ Esse único arquivo já é **`!ban @Joe spam`** e **`/ban`**, converte a menção no membro,
36
+ trata o erro se o Discord recusar e valida tudo antes do bot ligar.
37
+
38
+ ## 🚀 Começar
39
+
40
+ Precisa de **Node.js 22.18** ou mais novo e do token de um bot ([como criar](https://diracord.vercel.app/docs/getting-started)).
41
+
42
+ ```bash
43
+ npx diracord new my-bot
44
+ cd my-bot
45
+ cp .env.example .env # cole o token do bot depois do =
46
+ npx diracord run
47
+ ```
48
+
49
+ Mande `!ping` no Discord e o bot responde `Pong!`. O projeto novo já vem com `ping`, moedas
50
+ salvas, mensagem com botão e boas-vindas.
51
+
52
+ | comando | o que faz |
53
+ |---|---|
54
+ | `npx diracord new <pasta>` | cria um projeto pronto para rodar |
55
+ | `npx diracord check` | procura erros no projeto inteiro, com seta e sugestão |
56
+ | `npx diracord check --fix` | corrige sozinho o que é seguro |
57
+ | `npx diracord run` | liga o bot |
58
+ | `npx diracord watch` | liga e recarrega a cada arquivo salvo |
59
+
60
+ ## 🎯 Por que Diracord
61
+
62
+ | | Diracord | aoi.js | discord.js |
63
+ |---|:---:|:---:|:---:|
64
+ | Você escreve | arquivos `.dcs` | `$funções` em strings de JS | JavaScript |
65
+ | `!prefixo` e `/slash` no mesmo código | ✅ | ➖ | ➖ |
66
+ | Erros **antes** de rodar, com sugestão | ✅ | ❌ | ➖ |
67
+ | Correção automática (`--fix`) | ✅ | ❌ | ❌ |
68
+ | Variáveis, `if`, `for`, funções de verdade | ✅ | ➖ | ✅ |
69
+ | Banco de dados embutido | ✅ | ✅ | ❌ |
70
+ | Limites por comando (tempo, memória, ações) | ✅ | ❌ | ❌ |
71
+ | API completa do Discord | ➖ | ➖ | ✅ |
72
+
73
+ > Sem enrolação: se você precisa de voz, música ou sharding gigante, **discord.js** continua
74
+ > sendo a escolha certa. [Veja a comparação completa](https://diracord.vercel.app/docs/why).
75
+
76
+ ## 🧩 Components v2 como peças
77
+
78
+ Caixas, textos, botões e menus montados como no `ContainerBuilder` do discord.js, mas sem `new` nem `.add...`:
79
+
80
+ ```dcs
81
+ command("rules") {
82
+ reply container(
83
+ text("## Welcome, $user.name"),
84
+ section("Read the rules before you continue.", thumbnail: user.avatar),
85
+ separator(),
86
+ row(
87
+ button("accept", "I agree", style: "success"),
88
+ button(label: "Website", url: "https://example.com")
89
+ ),
90
+ color: "blurple"
91
+ )
92
+ }
93
+
94
+ button("accept") {
95
+ addRole user "Member"
96
+ reply "Welcome aboard!" ephemeral: true
97
+ }
98
+ ```
99
+
100
+ Se uma peça estiver no lugar errado, a seta aponta para ela: *"`button` vai dentro de `row(...)`"*.
101
+
102
+ ## 🩺 Erros que ensinam
103
+
104
+ ```text
105
+ erro[E0201]: A função `rpely` não existe
106
+ --> commands/ping.dcs:2:3
107
+ |
108
+ 2 | rpely "Pong!"
109
+ | ^^^^^ função desconhecida
110
+ |
111
+ = ajuda: você quis dizer `reply`?
112
+ = correção sugerida: trocar `rpely` por `reply`
113
+ ```
114
+
115
+ Todo erro tem um **código estável** (`E0201`) para pesquisar, mostra o arquivo e a linha com
116
+ uma seta e quase sempre sugere a correção. Os seguros o `check --fix` aplica sozinho
117
+ (`let` → `local`, `=` → `==` no `if`, `try` → `testing`, `memberjoin` → `memberJoin`...).
118
+
119
+ ## 🧰 O que vem pronto
120
+
121
+ | | |
122
+ |---|---|
123
+ | 💬 **54 funções** | mensagens, moderação, cargos, buscas, dados, texto, matemática, listas e Components v2 |
124
+ | 🗃️ **Dirabank** | banco embutido em **um arquivo só**, com escopos `user`, `server`, `member` e `global` |
125
+ | 🔁 **Funções próprias** | `fn giveCoins(who: member, amount: number = 1) { ... }`, com tipos opcionais |
126
+ | 🛡️ **Seguro por padrão** | limite de passos, tempo, memória e ações por comando: um `while true { }` não derruba o bot |
127
+ | ⚡ **Leve** | motor em Rust: ~2,5 MB de RAM e ~12 mil comandos por segundo (medido) |
128
+ | 🔌 **Sem discord.js** | conversa direto com o Gateway e a API do Discord, com cache mínimo |
129
+ | 🤖 **Feito para IAs** | [`llm.txt`](https://diracord.vercel.app/llm.txt) com a gramática completa, as funções e os erros comuns |
130
+
131
+ ## 📚 Documentação
132
+
133
+ - **[Primeiros passos](https://diracord.vercel.app/docs/getting-started)**: do zero ao bot online
134
+ - **[Dicas e comandos básicos](https://diracord.vercel.app/docs/tips)**: ban, mute, moedas, boas-vindas, cargo por botão
135
+ - **[Bugs e erros comuns](https://diracord.vercel.app/docs/mistakes)**: o que costuma dar errado e como evitar
136
+ - **[Sintaxe](https://diracord.vercel.app/docs/syntax)** · **[Funções próprias](https://diracord.vercel.app/docs/functions)** · **[Components v2](https://diracord.vercel.app/docs/components-v2)** · **[Dados salvos](https://diracord.vercel.app/docs/data)**
137
+ - **Vindo de outra ferramenta:** [aoi.js](https://diracord.vercel.app/docs/from-aoijs) · [discord.js](https://diracord.vercel.app/docs/from-discordjs)
138
+ - **Referência:** [todas as funções](https://diracord.vercel.app/docs/reference-functions) · [códigos de erro](https://diracord.vercel.app/docs/reference-errors)
139
+
140
+ ---
141
+
142
+ <div align="center">
143
+
144
+ **Diracord** é código aberto sob a licença [MIT](https://github.com/lexersonly/diracord/blob/claude/keen-johnson-qfd683/LICENSE). Versão 0.1: a linguagem e o motor são testados,
145
+ mas ainda podem mudar. Achou um bug? [Abra uma issue](https://github.com/lexersonly/diracord/issues).
146
+
147
+ </div>
Binary file
Binary file
Binary file
Binary file