.translate will now use 2 embeds

This commit is contained in:
Toastie 2024-12-10 22:32:08 +13:00
parent b3714d3c9e
commit b03b32436b
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4

View file

@ -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)
{