Make zoacao match rule editable in-game: mode + pattern + message list
Zoacao now matches a configurable pattern under a configurable mode (igual/contem/comeca/termina/regex) instead of only a bare 'f'. The mode, the trigger pattern, and the gag message list are all editable live via /canalhandia zoacao <listar|modo|padrao|adicionar|remover|limpar>; every change writes through to config.yml immediately. config.yml gains zoacao.correspondencia + zoacao.padrao (default igual + 'f'). Zoacao.replace/ matches gained a Mode + pattern signature; ZoacaoTest covers all five modes (incl. invalid-regex guard) and the byKey parser. 136 tests green. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ All player-facing text is Portuguese (pt-BR).
|
||||
| `ranking` | `/ranking mineracao` and friends. Covers **offline players too**. |
|
||||
| `marcos` | Announces round milestones — 100 km walked, 24 hours played — the first time someone crosses one. |
|
||||
| `mortes` | Replaces each death message with a comic pt-BR line (cause-based flavor + a death counter) and sends the death coordinates **privately** to the dead player on respawn (the death screen swallows chat sent during the event), so they can run back to their dropped items. Respects `keepInventory`. No storage, no command. |
|
||||
| `zoacao` | A bare `f`/`F` in chat (trimmed, nothing else) is swapped for a random line from `zoacao.mensagens` — a chat gag. The player's name still prefixes it. Pure chat swap; the `luto` tribute is unaffected (paying respects still needs the `[F]` button or `/f`). Affects Bedrock chat too (it's a chat event, not a click). |
|
||||
| `zoacao` | A chat message matching the trigger (a pattern + a match mode) is swapped for a random line from `zoacao.mensagens` — a chat gag. The player's name still prefixes it. Default: a bare `f`/`F` (trimmed) → a random gag line. Match modes: `igual` (equals), `contem` (contains), `comeca` (starts with), `termina` (ends with), `regex`. The mode, the pattern, and the message list are all editable in-game with `/canalhandia zoacao ...`. Pure chat swap; the `luto` tribute is unaffected (paying respects still needs the `[F]` button or `/f`). Affects Bedrock chat too (it's a chat event, not a click). |
|
||||
| `ia` | `/ia <pergunta>` asks an OpenAI-compatible model in chat. Optional wiki grounding, per-player memory, operator corrections. |
|
||||
|
||||
Toggle any of them: `/canalhandia modulo <nome> <on|off>`
|
||||
@@ -164,6 +164,12 @@ Admin (`canalhandia.admin`):
|
||||
/canalhandia modulo <nome> <on|off> liga/desliga um módulo
|
||||
/canalhandia marcos força uma verificação de marcos
|
||||
/canalhandia limpar [cooldown|historico|tudo]
|
||||
/canalhandia zoacao listar mostra a regra e as frases da zoação
|
||||
/canalhandia zoacao modo <m> igual | contem | comeca | termina | regex
|
||||
/canalhandia zoacao padrao <texto> texto/regex que dispara a zoação
|
||||
/canalhandia zoacao adicionar <frase> adiciona uma frase de zoação
|
||||
/canalhandia zoacao remover <n|texto> remove uma frase de zoação
|
||||
/canalhandia zoacao limpar volta para as frases padrão
|
||||
/canalhandia reload
|
||||
/curiosidade modo <entrada|intervalo|ambos|manual>
|
||||
/curiosidade intervalo <min> intervalo do modo temporizado
|
||||
|
||||
Reference in New Issue
Block a user