Implement the command parser

Right now this just supports help and version, but will be getting new commands
shortly.
This commit is contained in:
Gary Kramlich
2021-12-30 15:08:41 -06:00
parent 456a15ba56
commit 2279916d9c
8 changed files with 246 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ import (
type bridge struct {
UsernameTemplate string `yaml:"username_template"`
CommandPrefix string `yaml:"command_prefix"`
ManagementRoomText managementRoomText `yaml:"management_root_text"`
PortalMessageBuffer int `yaml:"portal_message_buffer"`
@@ -31,6 +33,10 @@ func (b *bridge) validate() error {
return err
}
if b.CommandPrefix == "" {
b.CommandPrefix = "!dis"
}
if err := b.ManagementRoomText.validate(); err != nil {
return err
}