Exemplo n.º 1
0
 public static DiscordWebhook ModifyWebhook(this DiscordClient client, ulong webhookId, DiscordWebhookProperties properties)
 {
     return(client.ModifyWebhookAsync(webhookId, properties).Result);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 /// <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);
 }
Exemplo n.º 4
0
 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));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Modifies the webhook
 /// </summary>
 /// <param name="properties">Options for modifying the webhook</param>
 public new void Modify(DiscordWebhookProperties properties)
 {
     ModifyAsync(properties).GetAwaiter().GetResult();
 }
Exemplo n.º 6
0
 public new async Task ModifyAsync(DiscordWebhookProperties properties)
 {
     Update(await Client.ModifyWebhookAsync(Id, properties));
 }
Exemplo n.º 7
0
 /// <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);
 }
Exemplo n.º 8
0
 public async Task <DiscordDefaultWebhook> CreateWebhookAsync(DiscordWebhookProperties properties)
 {
     return(await Client.CreateWebhookAsync(Id, properties));
 }
Exemplo n.º 9
0
        /// <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));
        }