Add discriminator to discord2mpp msgs

This commit is contained in:
Lamp 2018-10-03 12:06:20 -07:00 committed by GitHub
parent 9f54a04a75
commit 2923445645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -142,11 +142,12 @@ global.createMPPbridge = function createMPPbridge(room, DiscordChannelID, site =
dClient.on('message', async message => {
if (message.channel.id !== DiscordChannelID || message.author.bot || message.content.startsWith('!')) return;
var str = message.cleanContent;
var aname = `${message.member.displayName}#${message.member.user.discriminator}`;
var arr = [];
if (str.startsWith('/') || str.startsWith('\\'))
msgQueue.push(`${message.member.displayName}`);
msgQueue.push(`${aname}`);
else
str = message.member.displayName + ': ' + str;
str = `${aname}: ${str}`;
if (str.startsWith('\\')) str = str.slice(1);
if (message.attachments.first()) str += ' '+message.attachments.first().url;
if (str.length > 512) str = str.substr(0,511) + '…';