Remove the ability to create quotes from message ids

This commit is contained in:
runebaas 2020-11-25 15:21:55 +01:00
parent 09dbeb9766
commit baf09e2f38
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
4 changed files with 2 additions and 48 deletions

View file

@ -75,22 +75,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
await QuoteFromMention(user, false); await QuoteFromMention(user, false);
} }
[Command("add")]
[Alias("save")]
[Summary("Add a quote from a message id")]
public async Task AddQuote([Summary("message-ID")] ulong messageId)
{
await QuoteFromMessageId(messageId, true);
}
[Command("make")]
[Alias("preview")]
[Summary("Preview a quote from a message id")]
public async Task ReturnSpecifiedQuote([Summary("message-ID")] ulong messageId)
{
await QuoteFromMessageId(messageId, false);
}
[Command("add")] [Command("add")]
[Alias("save")] [Alias("save")]
[Summary("Add a quote from a message link")] [Summary("Add a quote from a message link")]
@ -208,20 +192,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
} }
private async Task QuoteFromMessageId(ulong messageId, bool saveToDb)
{
try
{
var message = await Context.Channel.GetMessageAsync(messageId);
await ProcessQuote(message, saveToDb, true);
}
catch (Exception e)
{
await ErrorHandler.HandleCommandException(e, Context, "I couldn't find a message with that id :disappointed:");
}
}
private async Task QuoteFromMessageLink(string messageLink, bool saveToDb) private async Task QuoteFromMessageLink(string messageLink, bool saveToDb)
{ {
try try
@ -253,7 +223,7 @@ namespace Geekbot.Bot.Commands.Utils.Quote
} }
} }
private async Task ProcessQuote(IMessage message, bool saveToDb, bool showMessageIdWarning = false) private async Task ProcessQuote(IMessage message, bool saveToDb)
{ {
if (message.Author.Id == Context.Message.Author.Id && saveToDb && !_isDev) if (message.Author.Id == Context.Message.Author.Id && saveToDb && !_isDev)
{ {
@ -278,7 +248,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
var sb = new StringBuilder(); var sb = new StringBuilder();
if (saveToDb) sb.AppendLine(Localization.Quote.QuoteAdded); if (saveToDb) sb.AppendLine(Localization.Quote.QuoteAdded);
if (showMessageIdWarning) sb.AppendLine(Localization.Quote.MessageIdDeprecation);
await ReplyAsync(sb.ToString(), false, embed.Build()); await ReplyAsync(sb.ToString(), false, embed.Build());
} }

View file

@ -78,15 +78,6 @@ namespace Geekbot.Bot.Localization {
} }
} }
/// <summary>
/// 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.
/// </summary>
internal static string MessageIdDeprecation {
get {
return ResourceManager.GetString("MessageIdDeprecation", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Most quoted person. /// Looks up a localized string similar to Most quoted person.
/// </summary> /// </summary>

View file

@ -44,7 +44,4 @@
<data name="OnlyQuoteFromSameServer" xml:space="preserve"> <data name="OnlyQuoteFromSameServer" xml:space="preserve">
<value>Du chasch numme nachrichte vom gliche server quote</value> <value>Du chasch numme nachrichte vom gliche server quote</value>
</data> </data>
<data name="MessageIdDeprecation" xml:space="preserve">
<value>:warning: Es mache vo quotes mit message-IDs isch zgunste vo message-links veraltet und wird am 1. dezember 2020 entfernt</value>
</data>
</root> </root>

View file

@ -51,7 +51,4 @@
<data name="OnlyQuoteFromSameServer" xml:space="preserve"> <data name="OnlyQuoteFromSameServer" xml:space="preserve">
<value>You can only quote messages from the same server</value> <value>You can only quote messages from the same server</value>
</data> </data>
<data name="MessageIdDeprecation" xml:space="preserve">
<value>:warning: Creating quotes by message ID is deprecated in favour of message links and will be removed on 1 December 2020</value>
</data>
</root> </root>