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

NUSBot Handler #2

@kennetham

Description

@kennetham

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions