Here's my code
var Botkit = require("botkit");
var simpleStorage = require("./simpleStorage")
...
var controller = Botkit.slackbot({
debug: false,
storage: simpleStorage()
});
...
controller.hears(['hello','hi'],'direct_message,direct_mention,mention',
function(bot, message) {
bot.reply(message,"Hello!");
controller.storage.teams.save({id: message.team, foo:"bar"}, function(err){console.log(err)});
controller.storage.teams.get(message.team, function(err){console.log(err)})
}
)
Note that controller.storage.teams.save is sucessfully creating a file under the teams directory containing {"id":"T0CV4J33N","foo":"bar"}. But I get the error Error: could not load data
Could it be that I'm calling get too soon after calling save?
My mistake, I misunderstood how simple_storage.js works.
@RafaelCosman This is the top result for "Botkit storage error Could not load data" right now haha.
For posterity, do you recall what you misunderstood?
Most helpful comment
@RafaelCosman This is the top result for "Botkit storage error Could not load data" right now haha.
For posterity, do you recall what you misunderstood?