Sha256: fe7d36f7fd0424b28b3c7c2fc5c1e2b0d1d11134647c94e13067754662e7b8db
Contents?: true
Size: 623 Bytes
Versions: 9
Compression:
Stored size: 623 Bytes
Contents
module MadChatter module Actions class Rename < MadChatter::Actions::Base @@regex = /\/nick (.+)/ def handle(message) if message.filtered_text =~ @@regex old_username = message.username 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 end def parse_username(text) @@regex.match(text).captures[0] end end end end
Version data entries
9 entries across 9 versions & 1 rubygems