diff --git a/discordo.go b/discordo.go index 0b0c8a9..53b99f4 100644 --- a/discordo.go +++ b/discordo.go @@ -236,16 +236,13 @@ func onChannelsTreeViewSelected(n *tview.TreeNode) { func onMessageInputFieldDone(k tcell.Key) { if k == tcell.KeyEnter { - currentText := messageInputField.GetText() - currentText = strings.TrimSpace(currentText) - + currentText := strings.TrimSpace(messageInputField.GetText()) if currentText == "" { return } - discordSession.SendMessage(currentChannel.ID, currentText) - messageInputField.SetText("") + go discordSession.SendMessage(currentChannel.ID, currentText) } }