fix: Translate command will no longer fail if the user capitalizes the language name

This commit is contained in:
Kwoth
2024-05-07 23:00:50 +00:00
parent b3a847e395
commit bbc277f4b9

View File

@@ -100,7 +100,7 @@ public sealed class TranslateService : ITranslateService, IExecNoCommand, IReady
if (string.IsNullOrWhiteSpace(text))
throw new ArgumentException("Text is empty or null", nameof(text));
var res = await _google.Translate(text, source, target);
var res = await _google.Translate(text, source.ToLowerInvariant(), target.ToLowerInvariant());
return res.SanitizeMentions(true);
}