forked from lug/matterbridge
Remove replace directives and use own fork to make go get work again (#1028)
See https://github.com/golang/go/issues/30354 go get doesn't honor the go.mod replace options.
This commit is contained in:
69
vendor/github.com/bwmarrin/discordgo/user.go
generated
vendored
69
vendor/github.com/bwmarrin/discordgo/user.go
generated
vendored
@@ -1,69 +0,0 @@
|
||||
package discordgo
|
||||
|
||||
import "strings"
|
||||
|
||||
// A User stores all data for an individual Discord user.
|
||||
type User struct {
|
||||
// The ID of the user.
|
||||
ID string `json:"id"`
|
||||
|
||||
// The email of the user. This is only present when
|
||||
// the application possesses the email scope for the user.
|
||||
Email string `json:"email"`
|
||||
|
||||
// The user's username.
|
||||
Username string `json:"username"`
|
||||
|
||||
// The hash of the user's avatar. Use Session.UserAvatar
|
||||
// to retrieve the avatar itself.
|
||||
Avatar string `json:"avatar"`
|
||||
|
||||
// The user's chosen language option.
|
||||
Locale string `json:"locale"`
|
||||
|
||||
// The discriminator of the user (4 numbers after name).
|
||||
Discriminator string `json:"discriminator"`
|
||||
|
||||
// The token of the user. This is only present for
|
||||
// the user represented by the current session.
|
||||
Token string `json:"token"`
|
||||
|
||||
// Whether the user's email is verified.
|
||||
Verified bool `json:"verified"`
|
||||
|
||||
// Whether the user has multi-factor authentication enabled.
|
||||
MFAEnabled bool `json:"mfa_enabled"`
|
||||
|
||||
// Whether the user is a bot.
|
||||
Bot bool `json:"bot"`
|
||||
}
|
||||
|
||||
// String returns a unique identifier of the form username#discriminator
|
||||
func (u *User) String() string {
|
||||
return u.Username + "#" + u.Discriminator
|
||||
}
|
||||
|
||||
// Mention return a string which mentions the user
|
||||
func (u *User) Mention() string {
|
||||
return "<@" + u.ID + ">"
|
||||
}
|
||||
|
||||
// AvatarURL returns a URL to the user's avatar.
|
||||
// size: The size of the user's avatar as a power of two
|
||||
// if size is an empty string, no size parameter will
|
||||
// be added to the URL.
|
||||
func (u *User) AvatarURL(size string) string {
|
||||
var URL string
|
||||
if u.Avatar == "" {
|
||||
URL = EndpointDefaultUserAvatar(u.Discriminator)
|
||||
} else if strings.HasPrefix(u.Avatar, "a_") {
|
||||
URL = EndpointUserAvatarAnimated(u.ID, u.Avatar)
|
||||
} else {
|
||||
URL = EndpointUserAvatar(u.ID, u.Avatar)
|
||||
}
|
||||
|
||||
if size != "" {
|
||||
return URL + "?size=" + size
|
||||
}
|
||||
return URL
|
||||
}
|
||||
Reference in New Issue
Block a user