You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
558 B
CoffeeScript

# Imports
Hook = require('hook.io').Hook
class Web40Hook extends Hook
constructor: (options) ->
self = this
Hook.call(self, options)
self.on 'hook::ready', ->
self.on '*::kill', (data,fn) ->
if data? && data == self.name
console.log "Shutting down, Sir"
fn(true)
self.kill()
self.on '*::ping', (data,fn) ->
self.emit 'pong', {'name':self.name}
fn(self.name)
module.exports.Web40Hook = Web40Hook