Sha256: 677a90180b9c162831f5ba845ebd8308645f92e6d1f49f49860cd39d5ca9a013

Contents?: true

Size: 476 Bytes

Versions: 4

Compression:

Stored size: 476 Bytes

Contents

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 from?(author)
      if author.respond_to? :id
        @user.id == author.id
      else
        @user.id == author
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
boty-0.0.13 lib/boty/message.rb
boty-0.0.12 lib/boty/message.rb
boty-0.0.11 lib/boty/message.rb
boty-0.0.10 lib/boty/message.rb