Milen/util/query.go

18 lines
446 B
Go

package util
import (
"github.com/bwmarrin/discordgo"
)
func GetMember(dg *discordgo.Session, guildID string, userID string) (*discordgo.Member, error) {
member, err := dg.State.Member(guildID, userID)
if err == nil {
return member, nil
}
return dg.GuildMember(guildID, userID)
}
func GetAvatar(dg *discordgo.Session, user *discordgo.User) string {
return "https://cdn.discordapp.com/avatars/" + user.ID + "/" + user.Avatar + ".png"
}