lib/mad_chatter/actions/rename.rb in mad_chatter-0.2.1 vs lib/mad_chatter/actions/rename.rb in mad_chatter-0.2.3
- old
+ new
@@ -1,14 +1,14 @@
module MadChatter
module Actions
- class Rename < MadChatter::Action
+ class Rename < MadChatter::Actions::Base
@@regex = /\/nick (.+)/
def handle(message)
- if message.text =~ @@regex
+ if message.filtered_text =~ @@regex
old_username = message.username
- username = parse_username(message.text)
+ username = parse_username(message.filtered_text)
MadChatter::Users.update(message.token, username)
send_status_message "#{old_username} is now known as #{username}"
send_users_list
stop_message_handling
end
\ No newline at end of file