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)
...
endAfter:
def self.call(client, data, match)
...
endThis also applies to command, operator and match blocks.
Before:
command 'ping' do |data, match|
...
endAfter:
command 'ping' do |client, data, match|
...
endYou 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'
enddef self.call(client, data, match)
send_message_with_gif client, data.channel, 'hello', 'hi'
end