Merge branch 'master' into 'master'

Fix chat on messages without name, i.e join/leave messages. Fix client sending...

See merge request ledlamp/discord-mpp-bridge!19
This commit is contained in:
Lamp 2019-06-28 23:35:57 +00:00
commit 7431a31a7e
1 changed files with 4 additions and 2 deletions

View File

@ -28,9 +28,11 @@ async function messagehandle(data) {
let roomName = data.roomName; let roomName = data.roomName;
let color = data.color; let color = data.color;
let id = data.id; let id = data.id;
if (id == "[discord.gg/k44Eqha]") return; if (id == client.socket.id) return;
let c = dClient.channels.get("593943518351982603"); let c = dClient.channels.get("593943518351982603");
if (c) c.send(`**${sanitizeName(name)}:** ${escapeDiscordMentions(data.message)}`); let msg;
(!name && (data.message.startsWith("[i]") || data.message.startsWith("[d]"))) ? msg = `*${escapeDiscordMentions(data.message)}*` : msg = `**${sanitizeName(name)}:** ${escapeDiscordMentions(data.message)}`;
if (c) c.send(msg);
} }
break; break;
} }