From 96851c7c2d8e4f2b683797ef55863be7b4cbe590 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 26 Dec 2023 17:02:02 +0000 Subject: [PATCH] Updated lib, fixed icon_url in .showembed --- .../Common/SmartText/SmartTextEmbedAuthor.cs | 2 ++ .../Common/SmartText/SmartTextEmbedFooter.cs | 2 ++ .../Modules/Administration/Self/DoAsUserMessage.cs | 13 ++++++++++++- src/NadekoBot/Modules/Utility/Utility.cs | 12 +++++++----- src/NadekoBot/NadekoBot.csproj | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/NadekoBot/Common/SmartText/SmartTextEmbedAuthor.cs b/src/NadekoBot/Common/SmartText/SmartTextEmbedAuthor.cs index 51e8369ea..5b243abe2 100644 --- a/src/NadekoBot/Common/SmartText/SmartTextEmbedAuthor.cs +++ b/src/NadekoBot/Common/SmartText/SmartTextEmbedAuthor.cs @@ -1,5 +1,6 @@ #nullable disable using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace NadekoBot; @@ -8,6 +9,7 @@ public class SmartTextEmbedAuthor public string Name { get; set; } [JsonProperty("icon_url")] + [JsonPropertyName("icon_url")] public string IconUrl { get; set; } public string Url { get; set; } diff --git a/src/NadekoBot/Common/SmartText/SmartTextEmbedFooter.cs b/src/NadekoBot/Common/SmartText/SmartTextEmbedFooter.cs index 19489881f..54f9ed0dd 100644 --- a/src/NadekoBot/Common/SmartText/SmartTextEmbedFooter.cs +++ b/src/NadekoBot/Common/SmartText/SmartTextEmbedFooter.cs @@ -1,5 +1,6 @@ #nullable disable using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace NadekoBot; @@ -8,5 +9,6 @@ public class SmartTextEmbedFooter public string Text { get; set; } [JsonProperty("icon_url")] + [JsonPropertyName("icon_url")] public string IconUrl { get; set; } } \ No newline at end of file diff --git a/src/NadekoBot/Modules/Administration/Self/DoAsUserMessage.cs b/src/NadekoBot/Modules/Administration/Self/DoAsUserMessage.cs index 849c7df3a..86d5ad2f2 100644 --- a/src/NadekoBot/Modules/Administration/Self/DoAsUserMessage.cs +++ b/src/NadekoBot/Modules/Administration/Self/DoAsUserMessage.cs @@ -5,7 +5,7 @@ namespace NadekoBot.Modules.Administration; public sealed class DoAsUserMessage : IUserMessage { private readonly string _message; - private IUserMessage _msg; + private readonly IUserMessage _msg; private readonly IUser _user; public DoAsUserMessage(SocketUserMessage msg, IUser user, string message) @@ -49,6 +49,13 @@ public sealed class DoAsUserMessage : IUserMessage return _msg.RemoveAllReactionsForEmoteAsync(emote, options); } + public IAsyncEnumerable> GetReactionUsersAsync( + IEmote emoji, + int limit, + RequestOptions? options = null, + ReactionType type = ReactionType.Normal) + => _msg.GetReactionUsersAsync(emoji, limit, options, type); + public IAsyncEnumerable> GetReactionUsersAsync(IEmote emoji, int limit, RequestOptions? options = null) { @@ -78,6 +85,7 @@ public sealed class DoAsUserMessage : IUserMessage public IMessageChannel Channel => _msg.Channel; public IUser Author => _user; + public IThreadChannel Thread => _msg.Thread; public IReadOnlyCollection Attachments => _msg.Attachments; @@ -106,6 +114,7 @@ public sealed class DoAsUserMessage : IUserMessage public MessageFlags? Flags => _msg.Flags; public IMessageInteraction Interaction => _msg.Interaction; + public MessageRoleSubscriptionData RoleSubscriptionData => _msg.RoleSubscriptionData; public Task ModifyAsync(Action func, RequestOptions? options = null) { @@ -134,5 +143,7 @@ public sealed class DoAsUserMessage : IUserMessage return _msg.Resolve(userHandling, channelHandling, roleHandling, everyoneHandling, emojiHandling); } + public MessageResolvedData ResolvedData => _msg.ResolvedData; + public IUserMessage ReferencedMessage => _msg.ReferencedMessage; } \ No newline at end of file diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 825d576cf..5a732290d 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -464,12 +464,14 @@ public partial class Utility : NadekoModule { if (tags.Length == 0) tags = new[] { name }; - - await ctx.Guild.CreateStickerAsync(name, - string.IsNullOrWhiteSpace(description) ? "Missing description" : description, - tags, + + await ctx.Guild.CreateStickerAsync( + name, stream, - $"{name}.{format}"); + $"{name}.{format}", + tags, + string.IsNullOrWhiteSpace(description) ? "Missing description" : description + ); await ctx.OkAsync(); } diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index 8e5ad93a1..ea32dd82c 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -27,7 +27,7 @@ - +