Fixed bug in hmm counter, added bugfix for node-irc for /mode bug
This commit is contained in:
parent
62fa1b015b
commit
cbc9689810
14
README.md
14
README.md
|
@ -4,8 +4,8 @@ aewens's IRC bot for irc.tilde.team
|
|||
|
||||
## Setting up
|
||||
|
||||
1. Install the dependencies using `$ npm install`
|
||||
2. Create the needed JSON files using:
|
||||
* Install the dependencies using `$ npm install`
|
||||
* Create the needed JSON files using:
|
||||
|
||||
```
|
||||
$ cp config.example.json config.json
|
||||
|
@ -14,5 +14,11 @@ $ cp blacklist.example.json blacklist.json
|
|||
|
||||
$ cp memories.example.json memories.json
|
||||
```
|
||||
3. Fill out the entries in `config.json`
|
||||
4. Run the bot using `node bot.js` or `npm start`
|
||||
* Fill out the entries in `config.json`
|
||||
* Run the bot using `node bot.js` or `npm start`
|
||||
|
||||
## FAQ
|
||||
|
||||
1. When someone runs /mode it sometimes breaks the bot, how do I fix this?
|
||||
|
||||
* In line 297 of node_modules/irc/lib/irc.js, change `} else {` to `} else if (channel.modeParams[mode]) {`
|
2
bot.js
2
bot.js
|
@ -267,7 +267,7 @@ const runLogic = (client, from, to, message) => {
|
|||
}
|
||||
|
||||
const hmm = new RegExp(/hm+/g);
|
||||
const hmms = message.match(hmm);
|
||||
const hmms = message ? message.match(hmm) : null;
|
||||
|
||||
if (hmms && !message.startsWith("!hmmscore")) {
|
||||
client.brain.memories.hmmscores = client.brain.memories.hmmscores || {};
|
||||
|
|
Loading…
Reference in New Issue