X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fmath.rb;h=afa4737cd9eff71bf10292245ea04e67c8a8b132;hb=9d29f400bb3a354779185d61049ce7cdfa7744ee;hp=4a207389b02bc8dad44f6d8f22c42f732ba0a709;hpb=21949774b91eaec6ecde4eaa8ad121e2c0a36b87;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/math.rb b/data/rbot/plugins/math.rb index 4a207389..afa4737c 100644 --- a/data/rbot/plugins/math.rb +++ b/data/rbot/plugins/math.rb @@ -22,6 +22,9 @@ class MathPlugin < Plugin "ten" => "10" }; + def name + "math" + end def help(plugin, topic="") "math , evaluate mathematical expression" end @@ -108,7 +111,7 @@ class MathPlugin < Plugin end m.reply answer rescue Exception => e - puts "couldn't evaluate expression \"#{m.params}\": #{e}" + error "couldn't evaluate expression \"#{m.params}\": #{e.inspect}" m.reply "illegal expression \"#{m.params}\"" return end @@ -120,3 +123,4 @@ class MathPlugin < Plugin end plugin = MathPlugin.new plugin.register("math") +plugin.register("maths")