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

@@ -4,6 +4,8 @@ import (
"fmt"
log "maunium.net/go/maulogger/v2"
"maunium.net/go/mautrix/appservice"
"maunium.net/go/mautrix/event"
"maunium.net/go/mautrix/id"
@@ -93,3 +95,15 @@ func (p *Portal) messageLoop() {
}
}
}
func (p *Portal) IsPrivateChat() bool {
return false
}
func (p *Portal) MainIntent() *appservice.IntentAPI {
if p.IsPrivateChat() {
return p.bridge.GetPuppetByID(p.Key.ID).DefaultIntent()
}
return p.bridge.bot
}