Skip to content
Snippets Groups Projects
Commit 31ae058b authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

test

parent 0d0398cc
No related branches found
No related tags found
No related merge requests found
...@@ -491,11 +491,11 @@ async function createMcChatWebhook(){ ...@@ -491,11 +491,11 @@ async function createMcChatWebhook(){
.catch(console.error); .catch(console.error);
} }
function sendMessageFromMcChat(username, message){ function sendMessageFromMcChat(name, message){
mcChatWebhook.send({ mcChatWebhook.send({
content: message, content: message,
username: username, username: name,
avatarURL: 'https://live.mc.sl-projects.com/tiles/faces/32x32/' + username + '.png', avatarURL: 'https://live.mc.sl-projects.com/tiles/faces/32x32/' + name + '.png',
}); });
} }
...@@ -525,6 +525,7 @@ app.get('/channels/:id', (req,res) => { ...@@ -525,6 +525,7 @@ app.get('/channels/:id', (req,res) => {
app.get('/mc/chat/:detail', (req,res) => { app.get('/mc/chat/:detail', (req,res) => {
var detail = JSON.parse(decodeURI(req.params.detail)); var detail = JSON.parse(decodeURI(req.params.detail));
sendMessageFromMcChat(detail.username, detail.message); sendMessageFromMcChat(detail.username, detail.message);
res.send("Envoyé!")
}) })
app.listen(27001, () => { app.listen(27001, () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment