Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////Bots
- SubscribeBot()
- {
- if (typeof FBInstant === 'undefined')return false;
- FBInstant.player.canSubscribeBotAsync().then(
- (_canSubscribe)=>{
- console.log("can_subsscribe"+_canSubscribe)
- if(_canSubscribe)
- {
- FBInstant.player.subscribeBotAsync().then(
- ()=>{
- console.log("player subscribed")
- this.CallBot();
- }
- ).catch(function (e) {
- console.log(e);
- });
- }
- }
- );
- }
- CallBot(_time:number=24)
- {
- if (typeof FBInstant === 'undefined') return;
- const MESSAGE_TO_BOT = { message: "Don't panic!" };
- console.log(MESSAGE_TO_BOT);
- FBInstant.setSessionData(MESSAGE_TO_BOT);
- const entryPointData = FBInstant.getEntryPointData();
- FBInstant.setSessionData(MESSAGE_TO_BOT) ;
- FBInstant.setSessionData({
- type:'PLAY_AGAIN',
- playAgainWaitTime:_time
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment