Added Role.Mention function
This commit is contained in:
parent
a0faf9a0d0
commit
5765bb7804
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,7 @@ package discordgo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -289,6 +290,11 @@ type Role struct {
|
||||||
Permissions int `json:"permissions"`
|
Permissions int `json:"permissions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mention returns a string which mentions the role
|
||||||
|
func (r *Role) Mention() string {
|
||||||
|
return fmt.Sprintf("<@&%s>", r.ID)
|
||||||
|
}
|
||||||
|
|
||||||
// Roles are a collection of Role
|
// Roles are a collection of Role
|
||||||
type Roles []*Role
|
type Roles []*Role
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue