aboutsummaryrefslogtreecommitdiff
path: root/module/test.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-20 04:23:20 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-04-20 04:23:20 -0700
commit7f134adccb20abe773234acecf526c9951b418e8 (patch)
treeeeb4b4f96a963591f244c8f661b84dd194cf1484 /module/test.rb
parent7e7aa3278a9e478b02eb152575fb00ee0802ac81 (diff)
downloaddinobot-7f134adccb20abe773234acecf526c9951b418e8.tar.gz
dinobot-7f134adccb20abe773234acecf526c9951b418e8.tar.xz
Improved namespace and directory structure.
Diffstat (limited to 'module/test.rb')
-rw-r--r--module/test.rb46
1 files changed, 46 insertions, 0 deletions
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