birdbot/common/user.go

20 lines
343 B
Go
Raw Normal View History

2023-03-30 23:51:05 -04:00
package common
import "fmt"
2023-03-31 20:49:50 +00:00
// User represents a user within BirdBot
2023-03-30 23:51:05 -04:00
type User struct {
ID string
AvatarURL string
DisplayName string
}
// DiscordMention generated a Discord mention string for the user
func (user *User) DiscordMention() string {
if user == nil {
return "<NULL>"
}
return fmt.Sprintf("<@%s>", user.ID)
}