Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Fluxer.Net/Fluxer.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- NuGet package info -->
<PackageId>Fluxer.Net</PackageId>
<Version>1.1.0</Version>
<Version>2.2.0</Version>
<Authors>Nexfinity</Authors>
<Company>Nexfinity</Company>
<Description>A .NET library for Fluxer bot development.</Description>
Expand Down
5 changes: 5 additions & 0 deletions Fluxer.Net/Rest/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,11 @@ public async Task ExecuteWebhookAsync(ulong webhookId, string token, string? con
await MakeFluxerApiRequestAsync(HttpMethod.Post, $"/webhooks/{webhookId}/{token}", req, true, false);
}

public async Task DeleteWebhookMessageAsync(ulong webhookId, string token, ulong messageId)
{
await MakeFluxerApiRequestAsync(HttpMethod.Delete, $"/webhooks/{webhookId}/{token}/messages/{messageId}", true);
}

public async Task<Message> EditWebhookMessageAsync(ulong webhookId, string token, ulong messageId, string? content = null, List<EmbedRequest>? embeds = null,
MessageReferenceRequest? reference = null, AllowedMentionsRequest? allowedMentions = null, MessageFlag flags = MessageFlag.None,
string? nonce = null, ulong? favoruteMemeId = null, bool? tts = null, List<ulong>? stickerIds = null)
Expand Down
11 changes: 11 additions & 0 deletions Fluxer.Net/Rest/Helpers/WebhookHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,19 @@ public static Task<Message> SendMessageWaitAsync(this Webhook webhook, string? c
string? nonce = null, ulong? favoruteMemeId = null, bool? tts = null, List<ulong>? stickerIds = null)
=> webhook.Client.Rest.ExecuteWebhookWaitAsync(webhook.Id, webhook.Token, content, embeds, reference, allowedMentions, flags, nonce, favoruteMemeId, tts, stickerIds);

public static Task DeleteMessageAsync(this Webhook webhook, Message message)
=> webhook.Client.Rest.EditWebhookMessageAsync(webhook.Id, webhook.Token, message.Id);

public static Task DeleteMessageAsync(this Webhook webhook, ulong messageId)
=> webhook.Client.Rest.EditWebhookMessageAsync(webhook.Id, webhook.Token, messageId);

public static Task<Message> EditMessageAsync(this Webhook webhook, ulong messageId, string? content = null, List<EmbedRequest>? embeds = null,
MessageReferenceRequest? reference = null, AllowedMentionsRequest? allowedMentions = null, MessageFlag flags = MessageFlag.None,
string? nonce = null, ulong? favoruteMemeId = null, bool? tts = null, List<ulong>? stickerIds = null)
=> webhook.Client.Rest.EditWebhookMessageAsync(webhook.Id, webhook.Token, messageId, content, embeds, reference, allowedMentions, flags, nonce, favoruteMemeId, tts, stickerIds);

public static Task<Message> EditMessageAsync(this Webhook webhook, Message message, string? content = null, List<EmbedRequest>? embeds = null,
MessageReferenceRequest? reference = null, AllowedMentionsRequest? allowedMentions = null, MessageFlag flags = MessageFlag.None,
string? nonce = null, ulong? favoruteMemeId = null, bool? tts = null, List<ulong>? stickerIds = null)
=> webhook.Client.Rest.EditWebhookMessageAsync(webhook.Id, webhook.Token, message.Id, content, embeds, reference, allowedMentions, flags, nonce, favoruteMemeId, tts, stickerIds);
}
Loading