Skip to content

Commit

Permalink
Add basic functionality for heat behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzokuken committed Aug 10, 2017
1 parent d7dd435 commit 8f93315
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/behaviors/heat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const Behavior = require('../models/behavior');
const utils = require('../utils');

let heatAction = () => {
return utils.exec('hddtemp /dev/sd?');
};

module.exports = new Behavior('message', heatAction, 'heat');
4 changes: 3 additions & 1 deletion src/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const state = {
const greetBehavior = require('./behaviors/greet');
const helpBehavior = require('./behaviors/help').helpBehavior;
const ftoBehavior = require('./behaviors/fto')(state);
const heatBehavior = require('./behaviors/heat');

// Read file synchronously because we'd need this object in later steps anyway.
const config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
Expand All @@ -31,7 +32,8 @@ const joinBehaviors = [

const messageBehaviors = [
helpBehavior,
ftoBehavior
ftoBehavior,
heatBehavior
];

const behaviors = new Behaviors(config.name, client, joinBehaviors, messageBehaviors);
Expand Down

0 comments on commit 8f93315

Please sign in to comment.