Bot dosent respond to himself in the autoresponse ( yea i forgot to put that in before, sorry )

This commit is contained in:
Loic Bersier 2018-09-21 15:31:34 +02:00
parent 6d14569c10
commit d2ded5baff

View file

@ -73,6 +73,8 @@ client.registry
// message.channel.send(delresponseObject[message_content]); // message.channel.send(delresponseObject[message_content]);
// } else // } else
// React to the message and send an auto response with it // React to the message and send an auto response with it
if (message.author.bot) return; {
if(responseObject[message_content] && reactObject[message_content]) { if(responseObject[message_content] && reactObject[message_content]) {
message.channel.send(responseObject[message_content]); message.channel.send(responseObject[message_content]);
message.react(reactObject[message_content]); message.react(reactObject[message_content]);
@ -85,7 +87,7 @@ client.registry
else if(responseObject[message_content]) { else if(responseObject[message_content]) {
message.channel.send(responseObject[message_content]); message.channel.send(responseObject[message_content]);
} }
}); }});
client.on('error', console.error); client.on('error', console.error);
process.on('unhandledRejection', error => console.error('Uncaught Promise Rejection', error)); process.on('unhandledRejection', error => console.error('Uncaught Promise Rejection', error));