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