From 7f134adccb20abe773234acecf526c9951b418e8 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 20 Apr 2014 04:23:20 -0700 Subject: Improved namespace and directory structure. --- module/test.rb | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 module/test.rb (limited to 'module/test.rb') diff --git a/module/test.rb b/module/test.rb new file mode 100644 index 0000000..e1d8358 --- /dev/null +++ b/module/test.rb @@ -0,0 +1,46 @@ +require_relative 'module' + +module Dinobot + module Module + class Test < Module + def initialize(bot) + super + + @commands << :echo << :ping << :x3 << :fooify + @commands << :error << :timeout << :wrongreturn << :invalidmethods + 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 + + def timeout(user, channel, argument) + sleep 60 + end + + def wrongreturn(user, channel, argument) + 0 + end + + def invalidmethods(user, channel, argument) + [[:say, channel]] + end + end + end +end -- cgit v1.2.3-70-g09d2