Don't shadow outer declaration

This commit is contained in:
James Nylen
2019-01-08 22:53:27 -05:00
parent aabf5dfed8
commit a8bdef3ce0

View File

@@ -119,9 +119,9 @@ func (b *Bdiscord) Connect() error {
b.canEditWebhooks = true
for _, channel := range b.channels {
b.Log.Debugf("found channel %#v; verifying PermissionManageWebhooks", channel)
perms, err := b.c.State.UserChannelPermissions(userinfo.ID, channel.ID)
perms, permsErr := b.c.State.UserChannelPermissions(userinfo.ID, channel.ID)
manageWebhooks := discordgo.PermissionManageWebhooks
if err != nil || perms&manageWebhooks != manageWebhooks {
if permsErr != nil || perms&manageWebhooks != manageWebhooks {
b.Log.Warnf("Can't manage webhooks in channel \"%s\"", channel.Name)
b.canEditWebhooks = false
}