예제 #1
0
 public static DiscordWebhook ModifyWebhook(this DiscordClient client, ulong webhookId, DiscordWebhookProperties properties)
 {
     return(client.ModifyWebhookAsync(webhookId, properties).Result);
 }
예제 #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);
        }
예제 #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);
 }
예제 #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));
 }
예제 #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();
 }
예제 #6
0
 public new async Task ModifyAsync(DiscordWebhookProperties properties)
 {
     Update(await Client.ModifyWebhookAsync(Id, properties));
 }
예제 #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);
 }
예제 #8
0
 public async Task <DiscordDefaultWebhook> CreateWebhookAsync(DiscordWebhookProperties properties)
 {
     return(await Client.CreateWebhookAsync(Id, properties));
 }
예제 #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));
        }