Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

NUSBot Handler #2

Open
kennetham opened this issue Jul 24, 2015 · 0 comments
Open

NUSBot Handler #2

kennetham opened this issue Jul 24, 2015 · 0 comments
Assignees

Comments

@kennetham
Copy link
Collaborator

Separate handler logic from main file

  • [v0.3.27] Refactored & added QueryPattern 9c66490

Ideally, a listener to poll for events, and a command handler to accept different commands rather than a long switch case.

bot.listen(:method => 'poll', :interval => 1)
bot.on :command, 'help' do #=> Refers to /help
  send_message("Help message")
end
bot.on :text, 'how are you' do
  send_message("I am good. How about you?")
end
@kennetham kennetham self-assigned this Jul 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant