mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 06:27:24 +00:00
Add cmdReply
This commit is contained in:
30
cmdReply.go
Normal file
30
cmdReply.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// +ignore
|
||||||
|
// +build allcommands replycmd
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
command := Command{
|
||||||
|
Cmd: []string{"reply", "re"},
|
||||||
|
Description: "$messageId $response - Reply to a message",
|
||||||
|
Help: "",
|
||||||
|
Exec: cmdReply,
|
||||||
|
}
|
||||||
|
|
||||||
|
RegisterCommand(command)
|
||||||
|
}
|
||||||
|
|
||||||
|
func cmdReply(cmd []string) {
|
||||||
|
chat := k.NewChat(channel)
|
||||||
|
messageId, err := strconv.Atoi(cmd[1])
|
||||||
|
_, err = chat.Reply(messageId, strings.Join(cmd[2:], " "))
|
||||||
|
if err != nil {
|
||||||
|
printToView("Feed", "There was an error with your reply.")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user