Revert "Disable message input if client does not have permission to send messages"
This reverts commit f58423bdaf.
This commit is contained in:
parent
f58423bdaf
commit
3632f70e54
1 changed files with 2 additions and 13 deletions
|
|
@ -198,21 +198,10 @@ func (gt *GuildsTree) onSelected(n *tview.TreeNode) {
|
|||
return
|
||||
}
|
||||
|
||||
clientID := discordState.Ready().User.ID
|
||||
perms, err := discordState.Permissions(c.ID, clientID)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
if perms.Has(discord.PermissionSendMessages) {
|
||||
app.SetFocus(mainFlex.messageInput)
|
||||
} else {
|
||||
mainFlex.messageInput.SetDisabled(true)
|
||||
}
|
||||
|
||||
mainFlex.messagesText.SetTitle(gt.channelToString(*c))
|
||||
|
||||
gt.selectedChannelID = ref
|
||||
app.SetFocus(mainFlex.messageInput)
|
||||
case nil: // Direct messages
|
||||
cs, err := discordState.Cabinet.PrivateChannels()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue