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.

19 lines
528 B

  1. module SlackRubyBot
  2. module Hooks
  3. module Message
  4. private
  5. # TODO: remove monkey-patch
  6. def parse_command(text)
  7. return unless text
  8. text = '= ' + text[1..text.length] if text[0] == '='
  9. parts = text.split.reject(&:blank?)
  10. if parts && parts[0] == '='
  11. parts[0] = SlackRubyBot.config.user
  12. parts.insert 1, 'calculate'
  13. end
  14. [parts.first.downcase, parts[1].try(:downcase), parts[2..parts.length]] if parts && parts.any?
  15. end
  16. end
  17. end
  18. end