Updated lib, fixed icon_url in .showembed

This commit is contained in:
Kwoth
2023-12-26 17:02:02 +00:00
parent 41ae182373
commit 96851c7c2d
5 changed files with 24 additions and 7 deletions

View File

@@ -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; }

View File

@@ -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; }
}

View File

@@ -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<IReadOnlyCollection<IUser>> GetReactionUsersAsync(
IEmote emoji,
int limit,
RequestOptions? options = null,
ReactionType type = ReactionType.Normal)
=> _msg.GetReactionUsersAsync(emoji, limit, options, type);
public IAsyncEnumerable<IReadOnlyCollection<IUser>> 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<IAttachment> 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<MessageProperties> 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;
}

View File

@@ -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();
}

View File

@@ -27,7 +27,7 @@
<PackageReference Include="CodeHollow.FeedReader" Version="1.2.4" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="CsvHelper" Version="28.0.1" />
<PackageReference Include="Discord.Net" Version="3.104.0" />
<PackageReference Include="Discord.Net" Version="3.203.0" />
<PackageReference Include="CoreCLR-NCalc" Version="2.2.110" />
<PackageReference Include="Google.Apis.Urlshortener.v1" Version="1.41.1.138" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.62.1.3205" />