atl will no longer post the translation if it's equivalent to the input message

updated packages
This commit is contained in:
Kwoth
2021-12-17 16:26:06 +01:00
parent 4c1b911cb7
commit a38951b5ad
4 changed files with 24 additions and 22 deletions

View File

@@ -56,6 +56,9 @@ namespace NadekoBot.Modules.Searches
public async Task LateExecute(IGuild guild, IUserMessage msg)
{
if (string.IsNullOrWhiteSpace(msg.Content))
return;
if (msg is IUserMessage { Channel: ITextChannel tch } um)
{
if (!_atcs.TryGetValue(tch.Id, out var autoDelete))
@@ -67,7 +70,8 @@ namespace NadekoBot.Modules.Searches
var output = await _google.Translate(msg.Content, langs.From, langs.To);
if (string.IsNullOrWhiteSpace(output))
if (string.IsNullOrWhiteSpace(output)
|| msg.Content.Equals(output, StringComparison.InvariantCultureIgnoreCase))
return;
var embed = _eb.Create()