diff --git a/src/Bot/Commands/Utils/Quote/Quote.cs b/src/Bot/Commands/Utils/Quote/Quote.cs index db6b1ac..0b197cd 100644 --- a/src/Bot/Commands/Utils/Quote/Quote.cs +++ b/src/Bot/Commands/Utils/Quote/Quote.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Text; using System.Threading.Tasks; using Discord; using Discord.Commands; @@ -211,10 +212,9 @@ namespace Geekbot.Bot.Commands.Utils.Quote { try { - // var transContext = await _translationHandler.GetGuildContext(Context); var message = await Context.Channel.GetMessageAsync(messageId); - await ProcessQuote(message, saveToDb); + await ProcessQuote(message, saveToDb, true); } catch (Exception e) { @@ -226,8 +226,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote { try { - // var transContext = await _translationHandler.GetGuildContext(Context); - if (!MessageLink.IsValid(messageLink)) { await ReplyAsync(Localization.Quote.NotAValidMessageLink); @@ -255,7 +253,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote } } - private async Task ProcessQuote(IMessage message, bool saveToDb) + private async Task ProcessQuote(IMessage message, bool saveToDb, bool showMessageIdWarning = false) { if (message.Author.Id == Context.Message.Author.Id && saveToDb && !_isDev) { @@ -277,7 +275,12 @@ namespace Geekbot.Bot.Commands.Utils.Quote } var embed = QuoteBuilder(quote); - await ReplyAsync(saveToDb ? Localization.Quote.QuoteAdded : string.Empty, false, embed.Build()); + + var sb = new StringBuilder(); + if (saveToDb) sb.AppendLine(Localization.Quote.QuoteAdded); + if (showMessageIdWarning) sb.AppendLine(Localization.Quote.MessageIdDeprecation); + + await ReplyAsync(sb.ToString(), false, embed.Build()); } private EmbedBuilder QuoteBuilder(QuoteModel quote) diff --git a/src/Bot/Localization/Quote.Designer.cs b/src/Bot/Localization/Quote.Designer.cs index 342c181..d0926ae 100644 --- a/src/Bot/Localization/Quote.Designer.cs +++ b/src/Bot/Localization/Quote.Designer.cs @@ -78,6 +78,15 @@ namespace Geekbot.Bot.Localization { } } + /// + /// Looks up a localized string similar to :warning: Creating quotes by message ID is deprecated in favour of message links and will be removed on 1 December 2020. + /// + internal static string MessageIdDeprecation { + get { + return ResourceManager.GetString("MessageIdDeprecation", resourceCulture); + } + } + /// /// Looks up a localized string similar to Most quoted person. /// diff --git a/src/Bot/Localization/Quote.de-ch.resx b/src/Bot/Localization/Quote.de-ch.resx index 99fd959..c7e3b8b 100644 --- a/src/Bot/Localization/Quote.de-ch.resx +++ b/src/Bot/Localization/Quote.de-ch.resx @@ -44,4 +44,7 @@ Du chasch numme nachrichte vom gliche server quote + + :warning: Es mache vo quotes mit message-IDs isch zgunste vo message-links veraltet und wird am 1. dezember 2020 entfernt + \ No newline at end of file diff --git a/src/Bot/Localization/Quote.resx b/src/Bot/Localization/Quote.resx index b51d79c..215f0ea 100644 --- a/src/Bot/Localization/Quote.resx +++ b/src/Bot/Localization/Quote.resx @@ -51,4 +51,7 @@ You can only quote messages from the same server + + :warning: Creating quotes by message ID is deprecated in favour of message links and will be removed on 1 December 2020 + \ No newline at end of file