Merge pull request #507 from CarsonHoffman/role-mention

Added Role.Mention function
This commit is contained in:
Bruce 2018-01-30 16:14:20 -06:00 committed by GitHub
commit 156f776f95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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