Skip to content

Instantly share code, notes, and snippets.

@nikitabugrovsky
Created July 7, 2016 17:36
Show Gist options
  • Save nikitabugrovsky/75472fe9dd4b028b559283aaadf0683a to your computer and use it in GitHub Desktop.
Save nikitabugrovsky/75472fe9dd4b028b559283aaadf0683a to your computer and use it in GitHub Desktop.
# Init
# ----
constructor: (msg, serverManager) ->
super msg
@_querystring = require 'querystring'
@_params = @msg.match[3].toString()
@_serverManager = serverManager
_init: (delayedFunction) =>
return true if @_serverManager.hasInitialized()
@reply "This is the first command run after startup. Please wait while we perform initialization..."
@_delayedFunction = delayedFunction
@list true
false
_initComplete: =>
if @_delayedFunction != null
@send "Initialization Complete. Running your request..."
setTimeout((() =>
@_delayedFunction()
@_delayedFunction = null
), 1000)
@mihaiturcu
Copy link

The .toString() fix is throwing ERROR TypeError: Cannot read property 'toString' of undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment