Permalink
Browse files

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

  • Loading branch information...
1 parent 8a04de8 commit 726751ce9b558b79483e4ce19bcb1ce63f16f900 @jimmyxu jimmyxu committed Jun 24, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 command.rb
View
@@ -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

0 comments on commit 726751c

Please sign in to comment.