Sha256: 7b5284c1178e30f115e656a2178f5dd9cb53d0117cae08492a70407017b3b9b6
Contents?: true
Size: 571 Bytes
Versions: 9
Compression:
Stored size: 571 Bytes
Contents
module MadChatter module Actions class Join < MadChatter::Actions::Base @@regex = /\/join (.+)/ def handle(message) if message.filtered_text =~ @@regex username = parse_username(message.filtered_text) MadChatter::Users.update(message.token, username) send_status_message "#{username} has joined the chatroom" 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