Skip to content

Commit

Permalink
Merge 32cb8e5 into f2e38a8
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren committed Nov 2, 2018
2 parents f2e38a8 + 32cb8e5 commit af1c6c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/behaviors/quiet.js
@@ -0,0 +1,11 @@
const MemoryBehavior = require('../models/memory-behavior');

// should run only on unrecognized users
const quietAction = (botNick, username) => {
if (username.match(/\[m\]/) !== null) exempt = true; // exempt matrix user
if (exempt) {
return `/quiet ${username}`;
}
};

module.exports = new MemoryBehavior('join', quietAction);
1 change: 1 addition & 0 deletions src/bot.js
Expand Up @@ -17,6 +17,7 @@ const ftoBehavior = require('./behaviors/fto')(state);
const heatBehavior = require('./behaviors/heat');
const unresponsiveBehavior = require('./behaviors/unresponsive')(state);
const versionBehavior = require('./behaviors/version');
const quietBehavior = require('./behaviors/quiet');

// Read file synchronously because we'd need this object in later steps anyway.
const configFile = path.join(__dirname, '../', 'config.json');
Expand Down

0 comments on commit af1c6c0

Please sign in to comment.