This version uses slack-ruby-client instead of slack-ruby-gem.
The command interface now takes a client
parameter, which is the RealTime Messaging API instance. Add the new parameter to all call
calls in classes that inherit from SlackRubyBot::Commands::Base
.
Before:
def self.call(data, match)
...
end
After:
def self.call(client, data, match)
...
end
This also applies to command
, operator
and match
blocks.
Before:
command 'ping' do |data, match|
...
end
After:
command 'ping' do |client, data, match|
...
end
You can now send messages directly via the RealTime Messaging API.
client.message text: 'text', channel: 'channel'
Otherwise you must now pass the client
parameter to send_message
and send_message_with_gif
.
def self.call(client, data, match)
send_message client, data.channel, 'hello'
end
def self.call(client, data, match)
send_message_with_gif client, data.channel, 'hello', 'hi'
end