Browse Source

Better error handling

pull/22/head
Gregory Rudolph 5 years ago
parent
commit
ec5c14d2cd
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 8
      cmdReply.go

8
cmdReply.go

@ -3,6 +3,7 @@
package main package main
import ( import (
"fmt"
"strconv" "strconv"
"strings" "strings"
) )
@ -20,8 +21,11 @@ func init() {
func cmdReply(cmd []string) { func cmdReply(cmd []string) {
chat := k.NewChat(channel) chat := k.NewChat(channel)
messageId, err := strconv.Atoi(cmd[1]) messageID, err := strconv.Atoi(cmd[1])
_, err = chat.Reply(messageId, strings.Join(cmd[2:], " ")) if err != nil {
printToView("Feed", fmt.Sprintf("There was an error determining message ID %s", cmd[1]))
}
_, err = chat.Reply(messageID, strings.Join(cmd[2:], " "))
if err != nil { if err != nil {
printToView("Feed", "There was an error with your reply.") printToView("Feed", "There was an error with your reply.")
} }

Loading…
Cancel
Save