A Slack Bot that pulls Pixiv information and posts the full image(s) into Slack, with iOS shortcuts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.2 KiB

9 years ago
  1. Upgrading SlackRubyBot
  2. ======================
  3. ### Upgrading to >= 0.4.0
  4. This version uses [slack-ruby-client](https://github.com/dblock/slack-ruby-client) instead of [slack-ruby-gem](https://github.com/aki017/slack-ruby-gem).
  5. 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`.
  6. Before:
  7. ```ruby
  8. def self.call(data, match)
  9. ...
  10. end
  11. ```
  12. After:
  13. ```ruby
  14. def self.call(client, data, match)
  15. ...
  16. end
  17. ```
  18. This also applies to `command`, `operator` and `match` blocks.
  19. Before:
  20. ```ruby
  21. command 'ping' do |data, match|
  22. ...
  23. end
  24. ```
  25. After:
  26. ```ruby
  27. command 'ping' do |client, data, match|
  28. ...
  29. end
  30. ```
  31. You can now send messages directly via the RealTime Messaging API.
  32. ```ruby
  33. client.message text: 'text', channel: 'channel'
  34. ```
  35. Otherwise you must now pass the `client` parameter to `send_message` and `send_message_with_gif`.
  36. ```ruby
  37. def self.call(client, data, match)
  38. send_message client, data.channel, 'hello'
  39. end
  40. ```
  41. ```ruby
  42. def self.call(client, data, match)
  43. send_message_with_gif client, data.channel, 'hello', 'hi'
  44. end
  45. ```