mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 13:43:06 -04:00
translate embed titles
This commit is contained in:
parent
7153c3ddaa
commit
2182947228
1 changed files with 3 additions and 0 deletions
|
@ -26,6 +26,7 @@ async function translateMessage(context, message, to, from){
|
|||
for(const e of message.embeds){
|
||||
let emb = e[1]
|
||||
if(emb.description) mappings["embeds/" + i + "/description"] = emb.description;
|
||||
if(emb.title) mappings["embeds/" + i + "/title"] = emb.title;
|
||||
if(emb.author?.name) mappings["embeds/" + i + "/author/name"] = emb.author.name;
|
||||
if(emb.footer?.text) mappings["embeds/" + i + "/footer/text"] = emb.footer.text;
|
||||
|
||||
|
@ -71,6 +72,8 @@ async function translateMessage(context, message, to, from){
|
|||
if(emb.image) newEmbed.image = emb.image;
|
||||
if(emb.url) newEmbed.url = emb.url;
|
||||
|
||||
if(emb.title) newEmbed.title = stringwrap(tr["embeds/" + i + "/title"], 256);
|
||||
|
||||
if(emb.description) newEmbed.description = stringwrap(tr["embeds/" + i + "/description"], 4096);
|
||||
|
||||
if(emb.author) newEmbed.author = Object.assign({}, emb.author);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue