From b03b32436b76927fa0113846aed684dcda1a5bd2 Mon Sep 17 00:00:00 2001 From: Toastie Date: Tue, 10 Dec 2024 22:32:08 +1300 Subject: [PATCH] .translate will now use 2 embeds --- .../Searches/Translate/TranslatorCommands.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs b/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs index 98037a5..198b99f 100644 --- a/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs +++ b/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs @@ -28,9 +28,19 @@ public partial class Searches await ctx.Channel.TriggerTypingAsync(); var translation = await _service.Translate(fromLang, toLang, text); - var embed = CreateEmbed().WithOkColor().AddField(fromLang, text).AddField(toLang, translation); + var embed = CreateEmbed() + .WithOkColor() + .WithTitle(fromLang) + .WithDescription(text); - await Response().Embed(embed).SendAsync(); + var embed2 = CreateEmbed() + .WithOkColor() + .WithTitle(toLang) + .WithDescription(translation); + + await Response() + .Embeds([embed, embed2]) + .SendAsync(); } catch { @@ -65,7 +75,10 @@ public partial class Searches [RequireContext(ContextType.Guild)] public async Task AutoTransLang(string fromLang, string toLang) { - var succ = await _service.RegisterUserAsync(ctx.User.Id, ctx.Channel.Id, fromLang.ToLower(), toLang.ToLower()); + var succ = await _service.RegisterUserAsync(ctx.User.Id, + ctx.Channel.Id, + fromLang.ToLower(), + toLang.ToLower()); if (succ is null) { @@ -89,8 +102,8 @@ public partial class Searches var langs = _service.GetLanguages().ToList(); var eb = CreateEmbed() - .WithTitle(GetText(strs.supported_languages)) - .WithOkColor(); + .WithTitle(GetText(strs.supported_languages)) + .WithOkColor(); foreach (var chunk in langs.Chunk(15)) {