translate embed titles

This commit is contained in:
bignutty 2025-01-28 16:08:17 +01:00
parent 7153c3ddaa
commit 2182947228

View file

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