diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-15 07:03:13 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-15 07:03:13 -0700 |
commit | 9f44e1d9372e4168def6e90f6b49d61c74f0045d (patch) | |
tree | 02c8e7b9d901a60635776a56d61cb4e3d051d5aa /test.rb | |
parent | b6d1cc2f13290970eb2fc0094c5d3f209d450d75 (diff) | |
download | dinobot-9f44e1d9372e4168def6e90f6b49d61c74f0045d.tar.gz dinobot-9f44e1d9372e4168def6e90f6b49d61c74f0045d.tar.xz |
Refactor and clean up core code.
Diffstat (limited to 'test.rb')
-rw-r--r-- | test.rb | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -5,13 +5,26 @@ module Dinobot def initialize(bot) super - @commands << :echo << :error << :timeout << :x3 << :wrongreturn << :fooify + @commands << :echo << :ping << :x3 << :fooify + @commands << :error << :timeout << :wrongreturn end def echo(user, channel, argument) [[:say, channel, argument]] end + def ping(user, channel, argument) + [[:say, channel, 'pong']] + end + + def x3(user, channel, argument) + [[:say, channel, argument]] * 3 + end + + def fooify(user, channel, argument) + [[:say, channel, 'foo' + argument]] + end + def error(user, channel, argument) x end @@ -20,16 +33,8 @@ module Dinobot sleep 60 end - def x3(user, channel, argument) - [[:say, channel, argument]] * 3 - end - def wrongreturn(user, channel, argument) 0 end - - def fooify(user, channel, argument) - [[:say, channel, 'foo' + argument]] - end end end |