public static DiscordWebhook ModifyWebhook(this DiscordClient client, ulong webhookId, DiscordWebhookProperties properties) { return(client.ModifyWebhookAsync(webhookId, properties).Result); }
public static async Task <DiscordDefaultWebhook> CreateWebhookAsync(this DiscordClient client, ulong channelId, DiscordWebhookProperties properties) { properties.ChannelId = channelId; DiscordDefaultWebhook hook = (await client.HttpClient.PostAsync($"/channels/{channelId}/webhooks", properties)).Deserialize <DiscordDefaultWebhook>().SetClient(client); hook.Modify(properties); return(hook); }
/// <summary> /// Creates a webhook /// </summary> /// <param name="channelId">ID of the channel</param> /// <param name="properties">Options for creating/modifying the webhook</param> /// <returns>The created webhook</returns> public static DiscordDefaultWebhook CreateWebhook(this DiscordClient client, ulong channelId, DiscordWebhookProperties properties) { return(client.CreateWebhookAsync(channelId, properties).Result); }
public static async Task <DiscordWebhook> ModifyWebhookAsync(this DiscordClient client, ulong webhookId, DiscordWebhookProperties properties) { return((await client.HttpClient.PatchAsync($"/webhooks/{webhookId}", properties)).ParseDeterministic <DiscordWebhook>().SetClient(client)); }
/// <summary> /// Modifies the webhook /// </summary> /// <param name="properties">Options for modifying the webhook</param> public new void Modify(DiscordWebhookProperties properties) { ModifyAsync(properties).GetAwaiter().GetResult(); }
public new async Task ModifyAsync(DiscordWebhookProperties properties) { Update(await Client.ModifyWebhookAsync(Id, properties)); }
/// <summary> /// Creates a webhook /// </summary> /// <param name="properties">Options for creating/modifying the webhook</param> /// <returns>The created webhook</returns> public DiscordDefaultWebhook CreateWebhook(DiscordWebhookProperties properties) { return(CreateWebhookAsync(properties).Result); }
public async Task <DiscordDefaultWebhook> CreateWebhookAsync(DiscordWebhookProperties properties) { return(await Client.CreateWebhookAsync(Id, properties)); }
/// <summary> /// Creates a webhook /// </summary> /// <param name="properties">Options for creating/modifying the webhook</param> /// <returns>The created webhook</returns> public DiscordWebhook CreateWebhook(DiscordWebhookProperties properties) { properties.ChannelId = Id; return(Client.CreateChannelWebhook(Id, properties)); }