Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Follow up dc6d78f, those lines won't be run on exception, ご主人様.

  • Loading branch information...
commit 726751ce9b558b79483e4ce19bcb1ce63f16f900 1 parent 8a04de8
@jimmyxu jimmyxu authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 command.rb
View
6 command.rb
@@ -25,6 +25,9 @@ def define_command(name, pattern, &block)
def process_message(user, message)
message = message.body.rstrip if message.respond_to? :body
result = ''
+ # XXX: Workaround for ``stack level too deep''
+ user.last_said = message unless message =~ /#{CommandLeaderRegex}!!\Z/
+ user.save
if message =~ CommandLeaderRegex
@@commands.each do |command|
match = message.lstrip.gsub(CommandLeaderRegex, '').match(command.pattern)
@@ -40,9 +43,6 @@ def process_message(user, message)
else
result = @@default_command.action.call(user, message)
end
- # XXX: Workaround for ``stack level too deep''
- user.last_said = message unless message =~ /#{CommandLeaderRegex}!!\Z/
- user.save
result
Please sign in to comment.
Something went wrong with that request. Please try again.