mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-12-02 20:02:53 +00:00
Merge pull request #62 from mavolin/56-webhooks
This commit is contained in:
commit
554be03fc1
|
@ -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.
|
||||
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
|
||||
return ws, c.RequestJSON(&ws, "GET", EndpointGuilds+guildID.String()+"/webhooks")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue