1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-12 08:25:10 +00:00

Merge pull request #62 from mavolin/56-webhooks

This commit is contained in:
diamondburned 2020-05-11 20:41:01 -07:00 committed by GitHub
commit 554be03fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,10 +41,18 @@ func (c *Client) CreateWebhook(
) )
} }
// Webhooks returns the guild webhooks. // ChannelWebhooks returns the webhooks of the channel with the given ID.
// //
// Requires the MANAGE_WEBHOOKS permission. // Requires the MANAGE_WEBHOOKS permission.
func (c *Client) Webhooks(guildID discord.Snowflake) ([]discord.Webhook, error) { func (c *Client) ChannelWebhooks(channelID discord.Snowflake) ([]discord.Webhook, error) {
var ws []discord.Webhook
return ws, c.RequestJSON(&ws, "GET", EndpointChannels+channelID.String()+"/webhooks")
}
// GuildWebhooks returns the webhooks of the guild with the given ID.
//
// Requires the MANAGE_WEBHOOKS permission.
func (c *Client) GuildWebhooks(guildID discord.Snowflake) ([]discord.Webhook, error) {
var ws []discord.Webhook var ws []discord.Webhook
return ws, c.RequestJSON(&ws, "GET", EndpointGuilds+guildID.String()+"/webhooks") return ws, c.RequestJSON(&ws, "GET", EndpointGuilds+guildID.String()+"/webhooks")
} }