From 9f44e1d9372e4168def6e90f6b49d61c74f0045d Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 15 Apr 2014 07:03:13 -0700 Subject: Refactor and clean up core code. --- test.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'test.rb') diff --git a/test.rb b/test.rb index a3a5a9a..e721104 100644 --- a/test.rb +++ b/test.rb @@ -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 -- cgit v1.2.3-70-g09d2