lib/slack-ruby-bot/client.rb in slack-ruby-bot-0.6.2 vs lib/slack-ruby-bot/client.rb in slack-ruby-bot-0.7.0
- old
+ new
@@ -1,9 +1,8 @@
module SlackRubyBot
class Client < Slack::RealTime::Client
include Loggable
- attr_accessor :auth
attr_accessor :aliases
attr_accessor :send_gifs
def initialize(attrs = {})
super(attrs)
@@ -12,18 +11,18 @@
end
def names
[
SlackRubyBot::Config.user,
- auth ? auth['user'] : nil,
+ self.self ? self.self.name : nil,
aliases,
SlackRubyBot::Config.aliases,
- auth ? "<@#{auth['user_id'].downcase}>" : nil,
+ self.self && self.self.id ? "<@#{self.self.id.downcase}>" : nil,
SlackRubyBot::Config.user_id ? "<@#{SlackRubyBot::Config.user_id.downcase}>" : nil,
- auth ? "<@#{auth['user_id'].downcase}>:" : nil,
+ self.self && self.self.id ? "<@#{self.self.id.downcase}>:" : nil,
SlackRubyBot::Config.user_id ? "<@#{SlackRubyBot::Config.user_id.downcase}>:" : nil,
- auth ? "#{auth['user']}:" : nil,
+ self.self && self.self.name ? "#{self.self.name.downcase}:" : nil,
SlackRubyBot::Config.user ? "#{SlackRubyBot::Config.user}:" : nil
].compact.flatten
end
def name?(name)
@@ -33,14 +32,14 @@
def send_gifs?
send_gifs
end
def name
- SlackRubyBot.config.user || (auth && auth['user'])
+ SlackRubyBot.config.user || (self.self && self.self.name)
end
def url
- SlackRubyBot.config.url || (auth && auth['url'])
+ SlackRubyBot.config.url || super
end
def say(options = {})
options = options.dup
# get GIF