Implement the command parser
Right now this just supports help and version, but will be getting new commands shortly.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user