Goroutinize *session.Session.SendMessage()
This commit is contained in:
parent
ca9eb30873
commit
69f7ac594c
1 changed files with 2 additions and 5 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue