Dont check emojis for all messages, only / commands

This commit is contained in:
CBenni 2018-01-04 21:47:26 +01:00
parent 56f1a5a952
commit 0d38fdaed2

View file

@ -198,7 +198,6 @@ function findEmoji(message) {
const ext = avatarMatch[2];
avatarUrl = `${avatarMatch[1]}128`;
}
console.log('Avatar url: ', avatarUrl);
return {
name: mentionedMember.displayName,
id: mentionedMember.id,
@ -235,6 +234,7 @@ client.on('message', async message => {
}
}
if (message.cleanContent[0] === '/') {
const messageSplit = message.cleanContent.split(' ');
const emoji = findEmoji(message);
let result = null;
@ -276,6 +276,7 @@ client.on('message', async message => {
} catch (err) {
console.error(err);
}
}
});
process.on('uncaughtException', exception => {