Dont check emojis for all messages, only / commands
This commit is contained in:
parent
56f1a5a952
commit
0d38fdaed2
1 changed files with 39 additions and 38 deletions
3
index.js
3
index.js
|
@ -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 => {
|
||||||
|
|
Reference in a new issue