/** * 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 = { '~wr': function(event) { var wolfram = new Client(this.config.api_key), query = event.input[1]; wolfram.query(query, function(err, result) { if(err) { event.reply(dbot.t('wolf_error')); console.log(err); } else { var out = ""; for(var a=0; a