feat: permitir comandos de robots sin prefijo !

Cuando command_prefix es "" en el config, el parser trata el primer token
del mensaje como nombre de comando sin requerir el prefijo !. Si el token
empieza con !, se le quita igualmente para retrocompatibilidad.

Cambios:
- pkg/message/parse.go: modo sin prefijo en Parse() (puro, sin side effects)
- agents/robot.go: mensaje "comando desconocido" y !help adaptados al prefijo
- agents/handler.go: mensaje "comando desconocido" adaptado al prefijo
- internal/config/schema.go: documentar command_prefix: "" en FiltersCfg
- agents/_template_robot/config.yaml: ejemplo comentado de command_prefix: ""

El comportamiento con command_prefix: "!" no cambia (retrocompatible).
This commit is contained in:
2026-04-09 20:10:03 +00:00
parent 945710034c
commit 421ab5c773
5 changed files with 49 additions and 15 deletions
+4
View File
@@ -263,6 +263,10 @@ type RoomsCfg struct {
}
type FiltersCfg struct {
// CommandPrefix is the prefix required for commands (e.g. "!" means "!help").
// Set to "" (empty) to allow commands without prefix — useful for robots where
// every message is a potential command. When empty, "!help" still works for
// backward compatibility (the leading "!" is stripped automatically).
CommandPrefix string `yaml:"command_prefix"`
MentionRespond bool `yaml:"mention_respond"`
DMRespond bool `yaml:"dm_respond"`