Browse Source

Add Math?

master
Daniel Muckerman 9 years ago
parent
commit
3e4d35e384
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      slack-mathbot/commands/calculate.rb

+ 3
- 2
slack-mathbot/commands/calculate.rb View File

@ -1,3 +1,5 @@
require Math
module SlackMathbot
module Commands
class Calculate < SlackRubyBot::Commands::Base
@ -5,8 +7,7 @@ module SlackMathbot
command 'calculate'
def self.call(client, data, match)
result = Dentaku::Calculator.new.evaluate(match[:expression])
#if match.names.include?('expression')
result = Dentaku::Calculator.new.evaluate(match[:expression]) if match.names.include?('expression')
result = result.to_s if result
if result && result.length > 0
send_message client, data.channel, result

Loading…
Cancel
Save