Hi, folks!
For curiosity i'm trying to use Node-RED for virtually linking two or more Discord chats in one stream.
The goal is to provide two or more roms with different languages which are linked by Hode-RED flow translation in a virtually one logical stream.
So say german-speaking users have german-translated chat where all the other room messages translated into german and, say, english-speaking users have english-translated chat where all german megssages are translated to english.
Now i have two needed dockerfiles running:
- Node-RED, with appropriate Discord and Telegram libraries;
- Working LibreTranslate image with all needed language translations.
Please, help me to properly tune Node-RED flow.
LibreTranslate accepts two forms of requests:
-
Simple http in a form like
http://192.168.1.200:8099/?source=en&target=de&q=Good%2520morning -
JSON like
const res = await fetch("http://192.168.1.200:8099/translate", {
method: "POST",
body: JSON.stringify({
q: "Good morning",
source: "en",
target: "de",
format: "text",
api_key: ""
}),
headers: { "Content-Type": "application/json" }
});
console.log(await res.json());