1
0
Fork 0
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:
diamondburned 2020-05-10 17:34:29 -07:00 committed by GitHub
commit 65bb8d21ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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