module Boty class Message attr_accessor :text, :user, :channel, :ts, :team attr_reader :match def initialize(data, match: nil) @text = data["text"] @user = Slack.users.info data["user"] @channel = data["channel"] @ts = data["ts"] @team = data["team"] @match = match end def match!(regex) @match = regex.match @text end def from?(author) if author.respond_to? :id @user.id == author.id else @user.id == author end end end end