internal static RestInternalWebhook Create(DiscordWebhookClient client, Model model) { var entity = new RestInternalWebhook(client, model); entity.Update(model); return(entity); }
/// <exception cref="InvalidOperationException">Could not find a webhook with the supplied credentials.</exception> public static async Task <RestInternalWebhook> GetWebhookAsync(DiscordWebhookClient client, ulong webhookId) { WebhookModel model = await client.ApiClient.GetWebhookAsync(webhookId).ConfigureAwait(false); if (model == null) { throw new InvalidOperationException("Could not find a webhook with the supplied credentials."); } return(RestInternalWebhook.Create(client, model)); }