 
     robot.brain.on 'save', (data = {}) ->
         isIRC = robot.adapterName is 'irc'
-        dweetRequest robot, '/dweet', encodeChildren(data, isIRC), (dweet) ->
+        dweetRequest robot, '/dweet', EncodeChildren(data, isIRC), (dweet) ->
             return robot.logger.error dweet.because if dweet.this is 'failed'
 
             status.lastSaved = dweet.with.created

DWEET_KEY = process.env.DWEET_KEY
DWEET_AUTOSAVE = process.env.DWEET_AUTOSAVE or 1800

toBase64 = (object) ->
    msgpack.pack(object).toString('base64')

fromBase64 = (encodedObject) ->
    msgpack.unpack new Buffer(encodedObject, 'base64')

encodeChildren = (object, ignoreUsers = false) ->
    encodedObject = {}
    for key, value of object
        continue if ignoreUsers and key is 'users'
        encodedObject[key] = toBase64 value
    encodedObject

decodeChildren = (object) ->
    decodedObject = {}
    for key, value of object
        decodedObject[key] = fromBase64 value
    decodedObject

module.exports = (robot) ->

#   Dweet.io and MsgPack powered Hubot Brain
#
# Dependencies:
#   "moment": "^2.8.3"
#   "msgpack": "^0.2.3"
#
# Commands:
