/** * Module Name: wolframalpha * Description: Calculates all kinds of stuff through Wolfram Alpha. * Requires: node-wolfram [https://github.com/strax/node-wolfram] */ var _ = require('underscore')._, Client = require('node-wolfram'); var wolframalpha = function(dbot) { this.commands = { '~calculate': function(event) { var wolfram = new Client(this.config.appID); var query = event.input[1]; wolfram.query(event.input[1], function(err, result) { if(err) event.reply(dbot.t('error')); else { var out = ""; for(var a=0; a