botkit-storage-firebase を使用して Firebase を Botkit に統合しようとしていますが、初期化時に次の警告が表示されます。
FIREBASE WARNING: Exception was thrown by user callback. TypeError: cb is not a function
at success (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:50:13)
at c (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:58)
at /Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:201:710
at ec (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:52:165)
at ac (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:31:216)
at $b (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:30:1198)
at Ri (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:224:313)
at X.h.Gb (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:238:140)
at X.h.Og (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:249)
at Object.get (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:47:31)
/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:52
(d="0"+d),c+=d;return c.toLowerCase()}var zd=/^-?\d{1,10}$/;function td(a){return zd.test(a)&&(a=Number(a),-2147483648<=a&&2147483647>=a)?a:null}function ec(a){try{a()}catch(b){setTimeout(function(){R("Exception was thrown by user callback.",b.stack||"");throw b;},Math.floor(0))}}function S(a,b){if(t(a)){var c=Array.prototype.slice.call(arguments,1).slice();ec(function(){a.apply(null,c)})}};function Ad(a){var b={},c={},d={},e="";try{var f=a.split("."),b=Pb(id(f[0])||""),c=Pb(id(f[1])||""),e=f[2],d=c.d||{};delete c.d}catch(g){}return{ph:b,Dc:c,data:d,bh:e}}function Bd(a){a=Ad(a).Dc;return"object"===typeof a&&a.hasOwnProperty("iat")?z(a,"iat"):null}function Cd(a){a=Ad(a);var b=a.Dc;return!!a.bh&&!!b&&"object"===typeof b&&b.hasOwnProperty("iat")};function Dd(a){this.Y=a;this.g=a.n.g}function Ed(a,b,c,d){var e=[],f=[];Na(b,function(b){"child_changed"===b.type&&a.g.Ad(b.Le,b.Ma)&&f.push(new H("child_moved",b.Ma,b.Ya))})
TypeError: cb is not a function
at success (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:50:13)
at c (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:58)
at /Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:201:710
at ec (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:52:165)
at ac (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:31:216)
at $b (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:30:1198)
at Ri (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:224:313)
at X.h.Gb (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:238:140)
at X.h.Og (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/firebase/lib/firebase-node.js:240:249)
at Object.get (/Users/ankitshekhawat/Downloads/botkit-master 2/node_modules/botkit-storage-firebase/src/index.js:47:31)
こんな感じで初期化しています。
var Botkit = require('botkit'),
firebaseStorage = require('botkit-storage-firebase')({firebase_uri: 'https://xxx.firebaseio.com/'}),
controller = Botkit.slackbot({
debug: true,
storage: firebaseStorage
});
// then you can use the Botkit storage api, make sure you have an id property
var beans = {id: 'cool', beans: ['pinto', 'garbanzo']};
controller.storage.teams.save(beans);
beans = controller.storage.teams.get('cool');
console.log(beans);
ただし、firebase コンソールに正常に投稿されたデータベース エントリを確認できます。問題が発生するのは
beans = controller.storage.teams.get('cool');
これを回避する方法はありますか?