lib/boty/message.rb in boty-0.0.9 vs lib/boty/message.rb in boty-0.0.10
- old
+ new
@@ -2,23 +2,22 @@
class Message
attr_accessor :text, :user, :channel, :ts, :team
attr_reader :match
def initialize(data, match: nil)
- @id = data["user"]
@text = data["text"]
- @user = data["user"]
+ @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
- @id == author.id
+ @user.id == author.id
else
- @id == author
+ @user.id == author
end
end
end
end