diff --git a/README.md b/README.md index 1f9aac3..e3d576a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Link channels between them easily using webhooks and by just completing the json - Warn if a server supposed to be in the linked channels is not here anymore or if a webhook is falsy. - EnhancedMention - mention a user/role/channel in another guild easily by simply using `@name` or `#name`. - ignore - Whether or not to ignore all messages coming from that channel. + - ignoreBots - Whether to accept bots message to gothrough the network. False by default ## Setup Clone this repository. @@ -31,7 +32,8 @@ Enter your bot token and all correct informations: "channelID": "121212", "whID": "232323", "whToken": "webhookToken2323", - "ignore": false + "ignore": false, + "ignoreBots": true }, "otherGuildName": { "guildID": "444444", diff --git a/config.template.json b/config.template.json index 12ce708..623ffc9 100644 --- a/config.template.json +++ b/config.template.json @@ -11,13 +11,15 @@ "channelID": "", "whID": "", "whToken": "", - "ignore": false + "ignore": false, + "ignoreBots": true }, "name2": { "guildID": "", "channelID": "", "whID": "", - "whToken": "" + "whToken": "", + "ignoreBots": true } } } diff --git a/index.js b/index.js index 6222140..d132d60 100644 --- a/index.js +++ b/index.js @@ -202,7 +202,8 @@ async function triggerWH(channel, user, content) { } bot.on('messageCreate', msg => { - if (!msg.author || msg.author.bot || !msg.channel.guild) { + + if (!msg.author || msg.author.discriminator === '0000' || !msg.channel.guild) { return; } @@ -211,7 +212,11 @@ bot.on('messageCreate', msg => { return; } - if (cur.ignore) { + if (msg.author.bot && cur.ignoreBots !== false) { // ignore bots if needed (check for false to not accept bot in case of not defined) + return; + } + + if (cur.ignore) { // ignore channels if needed return; }