forked from EllieBotDevs/elliebot
.translate will now use 2 embeds
This commit is contained in:
parent
b3714d3c9e
commit
b03b32436b
1 changed files with 18 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Reference in a new issue