Remove the ability to create quotes from message ids
This commit is contained in:
parent
09dbeb9766
commit
baf09e2f38
4 changed files with 2 additions and 48 deletions
|
@ -75,22 +75,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
|
|||
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")]
|
||||
[Alias("save")]
|
||||
[Summary("Add a quote from a message link")]
|
||||
|
@ -208,21 +192,7 @@ 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
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -278,7 +248,6 @@ namespace Geekbot.Bot.Commands.Utils.Quote
|
|||
|
||||
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());
|
||||
}
|
||||
|
|
9
src/Bot/Localization/Quote.Designer.cs
generated
9
src/Bot/Localization/Quote.Designer.cs
generated
|
@ -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>
|
||||
/// Looks up a localized string similar to Most quoted person.
|
||||
/// </summary>
|
||||
|
|
|
@ -44,7 +44,4 @@
|
|||
<data name="OnlyQuoteFromSameServer" xml:space="preserve">
|
||||
<value>Du chasch numme nachrichte vom gliche server quote</value>
|
||||
</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>
|
|
@ -51,7 +51,4 @@
|
|||
<data name="OnlyQuoteFromSameServer" xml:space="preserve">
|
||||
<value>You can only quote messages from the same server</value>
|
||||
</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>
|
Loading…
Reference in a new issue