adds /msetstate
This commit is contained in:
parent
576de5264e
commit
e9b76ccfec
@ -80,6 +80,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
|
|||||||
"send": {"sendevent"},
|
"send": {"sendevent"},
|
||||||
"msend": {"msendevent"},
|
"msend": {"msendevent"},
|
||||||
"state": {"setstate"},
|
"state": {"setstate"},
|
||||||
|
"mstate":{"msetstate"},
|
||||||
"rb": {"rainbow"},
|
"rb": {"rainbow"},
|
||||||
},
|
},
|
||||||
commands: map[string]CommandHandler{
|
commands: map[string]CommandHandler{
|
||||||
@ -95,6 +96,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
|
|||||||
"sendevent": cmdSendEvent,
|
"sendevent": cmdSendEvent,
|
||||||
"msendevent": cmdMSendEvent,
|
"msendevent": cmdMSendEvent,
|
||||||
"setstate": cmdSetState,
|
"setstate": cmdSetState,
|
||||||
|
"msetstate": cmdMSetState,
|
||||||
"rainbow": cmdRainbow,
|
"rainbow": cmdRainbow,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,15 @@ func cmdSendEvent(cmd *Command) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cmdMSetState(cmd *Command) {
|
||||||
|
if len(cmd.Args) < 2 {
|
||||||
|
cmd.Reply("Usage: /msetstate <event type> <state key> <content>")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cmd.Args = append([]string{cmd.Room.MxRoom().ID},cmd.Args...)
|
||||||
|
cmdSetState(cmd)
|
||||||
|
}
|
||||||
|
|
||||||
func cmdSetState(cmd *Command) {
|
func cmdSetState(cmd *Command) {
|
||||||
if len(cmd.Args) < 4 {
|
if len(cmd.Args) < 4 {
|
||||||
cmd.Reply("Usage: /setstate <room id> <event type> <state key/`-`> <content>")
|
cmd.Reply("Usage: /setstate <room id> <event type> <state key/`-`> <content>")
|
||||||
|
Loading…
Reference in New Issue
Block a user