Add missing REST Webhook implemenation (#843)

* Add Webhook API models, REST implementation, and Socket bridges.

* Remove token overrides from REST.

Leaving that as a Webhook package only feature.

* Add Webhook API models, REST implementation, and Socket bridges.

* Remove token overrides from REST.

Leaving that as a Webhook package only feature.

* Webhook core implementation.

* Webhook REST implementation.

* Webhook client implementation.

* Add channel bucket id.
This commit is contained in:
Alex Gravely
2017-12-23 15:17:20 -05:00
committed by Christopher F
parent a19ff188e9
commit 7b2ddd027c
27 changed files with 680 additions and 41 deletions

View File

@@ -144,6 +144,14 @@ namespace Discord.Rest
return null;
}
public static async Task<RestWebhook> GetWebhookAsync(BaseDiscordClient client, ulong id, RequestOptions options)
{
var model = await client.ApiClient.GetWebhookAsync(id);
if (model != null)
return RestWebhook.Create(client, (IGuild)null, model);
return null;
}
public static async Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(BaseDiscordClient client, RequestOptions options)
{
var models = await client.ApiClient.GetVoiceRegionsAsync(options).ConfigureAwait(false);