using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Discord.API.Rest;
using Discord.Rest;
using ImageModel = Discord.API.Image;
using WebhookModel = Discord.API.Webhook;
namespace Discord.Webhook
{
internal static class WebhookClientHelper
{
/// Could not find a webhook with the supplied credentials.
public static async Task GetWebhookAsync(DiscordWebhookClient client, ulong webhookId)
{
var 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);
}
public static async Task SendMessageAsync(DiscordWebhookClient client,
string text, bool isTTS, IEnumerable