Milen/util/perm.go

15 lines
307 B
Go

package util
import (
"github.com/bwmarrin/discordgo"
)
func HasAdmin(dg *discordgo.Session, userID string, channelID string) bool {
perm, err := dg.UserChannelPermissions(userID, channelID)
if err != nil {
ReportError(dg, err)
return false
}
return perm&discordgo.PermissionAdministrator != 0
}