From 7e61f7fb4679af6f67d347204f08058ca16b585e Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 13 Jan 2023 22:55:09 +0100 Subject: [PATCH] Improved how stickeradd works. Optional parameters will be a hidden feature as it's hard to explain. Tags are now also optional. --- src/NadekoBot/Modules/Utility/Utility.cs | 4 ++++ src/NadekoBot/data/strings/commands/commands.en-US.yml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 0d2282c36..374bba0ac 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -416,6 +416,7 @@ public partial class Utility : NadekoModule { name ??= ss.Name; description = ss.Description; + tags = tags is null or { Length: 0 } ? ss.Tags.ToArray() : tags; format = FormatToExtension(ss.Format); using var http = _httpFactory.CreateClient(); @@ -461,6 +462,9 @@ public partial class Utility : NadekoModule try { + if (tags.Length == 0) + tags = new[] { name }; + await ctx.Guild.CreateStickerAsync(name, string.IsNullOrWhiteSpace(description) ? "Missing description" : description, tags, diff --git a/src/NadekoBot/data/strings/commands/commands.en-US.yml b/src/NadekoBot/data/strings/commands/commands.en-US.yml index f6e0602dd..17e932f80 100644 --- a/src/NadekoBot/data/strings/commands/commands.en-US.yml +++ b/src/NadekoBot/data/strings/commands/commands.en-US.yml @@ -1248,7 +1248,8 @@ emojiremove: stickeradd: desc: "Adds the sticker from your message to this server. Send the sticker along with this command (in the same message)." args: - - "optionalname \"optional description\" tag1 tag2 tagN" + - "" + - "name \"description\" tag1 tag2 tagN" deckshuffle: desc: "Reshuffles all cards back into the deck." args: