aboutsummaryrefslogtreecommitdiff
path: root/module/test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'module/test.rb')
-rw-r--r--module/test.rb32
1 files changed, 15 insertions, 17 deletions
diff --git a/module/test.rb b/module/test.rb
index f728930..cfc929b 100644
--- a/module/test.rb
+++ b/module/test.rb
@@ -7,39 +7,37 @@ module Dinobot
super
@commands << :echo << :ping << :x3 << :fooify
- @commands << :error << :timeout << :wrongreturn << :invalidmethods
+ @commands << :error << :timeout << :invalidresponse
end
- def echo(user, channel, argument)
- [[:say, channel, argument]]
+ def echo(m, args)
+ m.response << [:say, m.channel, args]
end
- def ping(user, channel, argument)
- [[:say, channel, 'pong']]
+ def ping(m, args)
+ m.response << [:say, m.channel, 'pong']
end
- def x3(user, channel, argument)
- [[:say, channel, argument]] * 3
+ def x3(m, args)
+ 3.times do
+ m.response << [:say, m.channel, args]
+ end
end
- def fooify(user, channel, argument)
- [[:say, channel, 'foo' + argument]]
+ def fooify(m, args)
+ m.response << [:say, m.channel, "foo#{args}"]
end
- def error(user, channel, argument)
+ def error(m, args)
x
end
- def timeout(user, channel, argument)
+ def timeout(m, args)
sleep 60
end
- def wrongreturn(user, channel, argument)
- 0
- end
-
- def invalidmethods(user, channel, argument)
- [[:say, channel]]
+ def invalidresponse(m, args)
+ m.response << [:say, m.channel]
end
end
end