mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-23 04:57:16 +00:00
Merge pull request #34 from mavolin/31-guild-image-style
This commit is contained in:
commit
65bb8d21ee
16
api/guild.go
16
api/guild.go
|
@ -275,21 +275,21 @@ func (c *Client) GuildVanityURL(guildID discord.Snowflake) (*discord.Invite, err
|
|||
return inv, c.RequestJSON(&inv, "GET", EndpointGuilds+guildID.String()+"/vanity-url")
|
||||
}
|
||||
|
||||
type GuildImageType string
|
||||
type GuildImageStyle string
|
||||
|
||||
const (
|
||||
GuildShield GuildImageType = "shield"
|
||||
GuildBanner1 GuildImageType = "banner1"
|
||||
GuildBanner2 GuildImageType = "banner2"
|
||||
GuildBanner3 GuildImageType = "banner3"
|
||||
GuildBanner4 GuildImageType = "banner4"
|
||||
GuildShield GuildImageStyle = "shield"
|
||||
GuildBanner1 GuildImageStyle = "banner1"
|
||||
GuildBanner2 GuildImageStyle = "banner2"
|
||||
GuildBanner3 GuildImageStyle = "banner3"
|
||||
GuildBanner4 GuildImageStyle = "banner4"
|
||||
)
|
||||
|
||||
func (c *Client) GuildImageURL(guildID discord.Snowflake, img GuildImageType) string {
|
||||
func (c *Client) GuildImageURL(guildID discord.Snowflake, img GuildImageStyle) string {
|
||||
return EndpointGuilds + guildID.String() + "/widget.png?style=" + string(img)
|
||||
}
|
||||
|
||||
func (c *Client) GuildImage(guildID discord.Snowflake, img GuildImageType) (io.ReadCloser, error) {
|
||||
func (c *Client) GuildImage(guildID discord.Snowflake, img GuildImageStyle) (io.ReadCloser, error) {
|
||||
r, err := c.Request("GET", c.GuildImageURL(guildID, img))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue