aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/messageinfo.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/messageinfo.rb b/core/messageinfo.rb
index 4499bdc..627ca90 100644
--- a/core/messageinfo.rb
+++ b/core/messageinfo.rb
@@ -9,6 +9,21 @@ module Dinobot
@message = message
@response = []
end
+
+ def respond(arr)
+ raise "response not array -- #{arr}" unless arr.is_a?(Array)
+
+ case arr.first
+ when :say
+ raise "wrong number of arguments -- #{arr}" unless arr.length == 3
+ when :join, :part, :quit
+ raise "wrong number of arguments -- #{arr}" unless arr.length == 2
+ else
+ raise "unknown method name -- #{arr}"
+ end
+
+ @response << arr
+ end
end
end
end