adds /msend
This commit is contained in:
parent
01523ae8ce
commit
576de5264e
@ -78,6 +78,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
|
|||||||
aliases: map[string]*Alias{
|
aliases: map[string]*Alias{
|
||||||
"part": {"leave"},
|
"part": {"leave"},
|
||||||
"send": {"sendevent"},
|
"send": {"sendevent"},
|
||||||
|
"msend": {"msendevent"},
|
||||||
"state": {"setstate"},
|
"state": {"setstate"},
|
||||||
"rb": {"rainbow"},
|
"rb": {"rainbow"},
|
||||||
},
|
},
|
||||||
@ -92,6 +93,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
|
|||||||
"toggle": cmdToggle,
|
"toggle": cmdToggle,
|
||||||
"logout": cmdLogout,
|
"logout": cmdLogout,
|
||||||
"sendevent": cmdSendEvent,
|
"sendevent": cmdSendEvent,
|
||||||
|
"msendevent": cmdMSendEvent,
|
||||||
"setstate": cmdSetState,
|
"setstate": cmdSetState,
|
||||||
"rainbow": cmdRainbow,
|
"rainbow": cmdRainbow,
|
||||||
},
|
},
|
||||||
|
@ -129,6 +129,15 @@ func cmdJoin(cmd *Command) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cmdMSendEvent(cmd *Command) {
|
||||||
|
if len(cmd.Args) < 2 {
|
||||||
|
cmd.Reply("Usage: /msend <event type> <content>")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cmd.Args = append([]string{cmd.Room.MxRoom().ID},cmd.Args...)
|
||||||
|
cmdSendEvent(cmd)
|
||||||
|
}
|
||||||
|
|
||||||
func cmdSendEvent(cmd *Command) {
|
func cmdSendEvent(cmd *Command) {
|
||||||
debug.Print(cmd.Command, cmd.Args, len(cmd.Args))
|
debug.Print(cmd.Command, cmd.Args, len(cmd.Args))
|
||||||
if len(cmd.Args) < 3 {
|
if len(cmd.Args) < 3 {
|
||||||
|
Loading…
Reference in New Issue
Block a user