Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define hooks from within the bot instance #211

Open
dblock opened this issue Jan 16, 2019 · 0 comments
Open

Define hooks from within the bot instance #211

dblock opened this issue Jan 16, 2019 · 0 comments

Comments

@dblock
Copy link
Collaborator

dblock commented Jan 16, 2019

Coming from #154

It would be nice if some common hooks could be defined alongside command, e.g. :

  class MyBot < SlackRubyBot::Bot
    command 'ping' do |client, data|
      client.say(text: 'pong', channel: data.channel)
    end

    hello do |client, data|
      ...
    end
    
    # or
    hook 'hello' do |client, data|
      ...
    end
  end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant