mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 05:17:27 +00:00
Added error check on sendChat
This commit is contained in:
9
main.go
9
main.go
@ -99,9 +99,12 @@ func populateChat(g *gocui.Gui) {
|
||||
|
||||
}
|
||||
|
||||
func sendChat(message string) {
|
||||
func sendChat(message string, g *gocui.Gui) {
|
||||
chat := k.NewChat(channel)
|
||||
chat.Send(message)
|
||||
_, err := chat.Send(message)
|
||||
if err != nil {
|
||||
printToView(g,"Feed",fmt.Sprintf("There was an error %+v", err))
|
||||
}
|
||||
}
|
||||
func formatOutput(api keybase.ChatAPI) string {
|
||||
ret := ""
|
||||
@ -123,7 +126,7 @@ func uploadFile(g *gocui.Gui, filePath string, fileName string) {
|
||||
if err != nil {
|
||||
printToView(g, "Feed", fmt.Sprintf("There was an error uploading %s to %s", filePath, channel.Name))
|
||||
} else {
|
||||
printToView(g, "Feed", fmt.Sprintf("Uploaded %s to %s\n%+v", filePath, channel.Name, err))
|
||||
printToView(g, "Feed", fmt.Sprintf("Uploaded %s to %s", filePath, channel.Name))
|
||||
}
|
||||
}
|
||||
func downloadFile(g *gocui.Gui, messageID int, fileName string) {
|
||||
|
||||
Reference in New Issue
Block a user