Added more Mention methods

This commit is contained in:
diamondburned (Forefront) 2020-01-23 21:45:47 -08:00
parent 4dcb6178c8
commit e61d6f5ccf
3 changed files with 16 additions and 0 deletions

View File

@ -41,6 +41,10 @@ type Channel struct {
VoiceUserLimit uint `json:"user_limit,omitempty"`
}
func (ch Channel) Mention() string {
return "<#" + ch.ID.String() + ">"
}
type ChannelType uint8
const (

View File

@ -65,6 +65,10 @@ type Role struct {
Mentionable bool `json:"mentionable"`
}
func (r Role) Mention() string {
return "<&" + r.ID.String() + ">"
}
type Presence struct {
User User `json:"user"`
RoleIDs []Snowflake `json:"roles"`
@ -100,6 +104,10 @@ type Member struct {
Mute bool `json:"mute"`
}
func (m Member) Mention() string {
return "<@!" + m.User.ID.String() + ">"
}
type Ban struct {
Reason string `json:"reason,omitempty"`
User User `json:"user"`

View File

@ -21,6 +21,10 @@ type User struct {
Nitro UserNitro `json:"premium_type,omitempty"`
}
func (u User) Mention() string {
return "<@" + u.ID.String() + ">"
}
type UserFlags uint16
const (