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:
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.
|
// 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")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue