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.

28 lines
723 B

  1. require 'slack-ruby-bot'
  2. require 'wolfram'
  3. module NumberManBot
  4. class App < SlackRubyBot::App
  5. end
  6. class Ping < SlackRubyBot::Commands::Base
  7. def self.call(client, data, _match)
  8. client.message text: 'pong', channel: data.channel
  9. end
  10. end
  11. class Weather < SlackRubyBot::Commands::Base
  12. match(/^How is the weather in (?<location>\w*)\?$/i) do |client, data, match|
  13. send_message client, data.channel, "The weather in #{match[:location]} is nice."
  14. end
  15. end
  16. class Calculator < SlackRubyBot::Commands::Base
  17. operator '=' do |_data, _match|
  18. # implementation detail
  19. send_message client, data.channel, "The weather in the net is nice."
  20. end
  21. end
  22. end
  23. NumberManBot::App.instance.run