From 4c339cb22b4952fb468da51aa6fab45200e19573 Mon Sep 17 00:00:00 2001 From: Lake Date: Fri, 30 Jun 2017 12:38:02 -0400 Subject: [PATCH] Added --disable-gmsgs and --disable-chatmsgs --- README.md | 6 ++++++ config.json | 0 index.js | 2 +- run.sh | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 config.json diff --git a/README.md b/README.md index 8040ec1..de2cbde 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ Commands can be sent via DM or in the specified chat channel. # Terminal Commands `exit` +# Configuration +You can configure the bot with a number of arguments. +- `--disable-commands` - Disable Discord commands such as 7dtd!time. Does not disable 7dtd!info. +- `--disable-chatmsgs` - Disable chat messages. Does not disable other messages such as join/leave and deaths. +- `--disable-gmsgs` - Disable other messages. Includes deaths, leaves/joins, etc. + # How to Install - Windows ## Creating the bot account 1. Log in to the [Discord developers section](https://discordapp.com/developers/applications/me) and click "New App". diff --git a/config.json b/config.json deleted file mode 100644 index e69de29..0000000 diff --git a/index.js b/index.js index 03d1bdf..820c624 100644 --- a/index.js +++ b/index.js @@ -237,7 +237,7 @@ function handleMsgFromGame(line) { var split = line.split(" "); var type = split[3]; - if(type == "Chat:" || type == "GMSG:") { + if((argv["disable-chatmsgs"] !== 'true' && type == "Chat:") || (argv["disable-gmsgs"] !== 'true' && type == "GMSG:")) { // Make sure the channel exists. if(channel !== null) { // Cut off the timestamp and other info diff --git a/run.sh b/run.sh index 1c68985..70d7650 100644 --- a/run.sh +++ b/run.sh @@ -14,6 +14,6 @@ # Replace the following arguments with your Discord and game information. -node ./index.js --password="changeme" --token="your_token_here" --channel="channelid" --disable-commands=false +node ./index.js --password="changeme" --token="your_token_here" --channel="channelid" --disable-commands=false --disable-chatmsgs=false --disable-gmsgs=false read -p "Press enter to continue" nothing