diff options
author | destruc7i0n <destruc7i0n@users.noreply.github.com> | 2016-01-23 18:58:44 -0500 |
---|---|---|
committer | destruc7i0n <destruc7i0n@users.noreply.github.com> | 2016-01-23 18:58:44 -0500 |
commit | 2d83b4ecd205a4b22be402c54971f101c624e0c0 (patch) | |
tree | b0948f42512a13b8372173294adb9f417a1f81b6 | |
parent | Merge pull request #6 from SecretOnline/rcon-error (diff) | |
parent | Check Discord channel ID for incoming messages (diff) | |
download | shulker-2d83b4ecd205a4b22be402c54971f101c624e0c0.tar.gz shulker-2d83b4ecd205a4b22be402c54971f101c624e0c0.zip |
Merge pull request #7 from SecretOnline/filter
Only send messages in specified channel to Minecraft
-rw-r--r-- | index.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/index.js b/index.js index e034e9a..435ac15 100644 --- a/index.js +++ b/index.js @@ -67,11 +67,13 @@ shulker.on("ready", function() { }); shulker.on("message", function(message) { - if (message.author.id !== shulker.user.id) { - var data = { - text: "<" + message.author.username + "> " + message.content - }; - client.send('tellraw @a ["",' + JSON.stringify(data) + ']'); + if (message.channel.id === shulker.channels.get("name", c.DISCORD_CHANNEL).id) { + if (message.author.id !== shulker.user.id) { + var data = { + text: "<" + message.author.username + "> " + message.content + }; + client.send('tellraw @a ["",' + JSON.stringify(data) + ']'); + } } }); |