Press "Enter" to skip to content

Pair Programming a Facebook Messenger Bot – FunFunFunction #28


good Monday morning I am mpj and I’m

David and this is fun fun function we’re

here in Stockholm uh or I am here in

Stockholm David is always since calm but

we have these hack weekend’s where we

visit each other I come to Stockholm and

David comes to Gothenburg and we spend a

weekend just hacking away on the random

projects like trying to learn new things

or just build stupid things often stupid

yeah this is the first time I try to

involve somebody else in the infant

front function we are not exactly sure

how to go about this so you have to bear

with us as we figure out this format but

we do have a concept we want to try to

show you with us being two so we just

took the opportunity of Matthias being

here and just try to show up some pair

programming yeah right uh so pair

programming as a technique I’m not sure

if it originates from there but I

learned it when I learn to do extreme

programming XP and the basic idea is

that one person is a navigator and the

person that gives a sense of where the

production is heading and one person is

the driver and that is the person that

actually sits around six around writing

code we have a vague idea of what we

were going to try yeah we want to tag

along on there like the trends in

programming today and what everyone is

talking about so if you’re watching this

in the future this would seem very old

to you we’re gonna build a Facebook

Messenger but a big part everything is

about BOTS these days yep

so what are we going to build with our

BOTS like what can you do with facebook

messenger boss no one knows no we don’t

know we have intentionally not checked

the docks to – well our expectations is

that today we’re gonna have some kind of

live but for all the subscribers and

followers and viewers to actually use

and be able to interact with but we will

see what happens yeah that’s our goal we

wanted to build something that was sort

of useless we have this idea of

replicating a stupid thing a stupid bug

in the telecom you

station systems of Sweden that was

widely used in 1982 when you dialed a

number that was not connected nobody had

had that number yet everybody else that

called that same number also heard

everybody else on the line so it was

kind of basically a voice group chat

that was a completely unintentional

usage of the system this this became a

thing this was pre-internet so nobody

had any place to meet online because

online didn’t exist this was the closest

thing that occurred this was primarily a

popular among youth this was like my

what my my mother called into this thing

I this was my it wasn’t even born

no exactly you won’t burn either no this

was a chat before the concept of chat

was even around well of course I had

chats people were chatting with each

other but big so we’re bailing the spot

we will call it Stockholm hotline so

let’s get to it let’s get to it for I

think that we first have to find out

what the API of the messenger box all

right what can we do so we use AA

developer for facebook uh messenger

platform lalalalala where developer Docs

where where’s the cold messenger plugins

no this is not it the structured

template message will go

it’s just messenger codes and links okay

they’re coding links right ah invader

getting started okay you need to create

a facebook app or Facebook page set up a

web book okay cool under product

settings find the web hook enter

verified bla bla bla bla bla

well that’s look like oh this looks like

it right okay subscribe up to the page

receive messages this is the web hook

right what are we looking at here

I don’t know idea in your web book

listen post calls so this is what the

Facebook is going to post back to our

web

look this is the messages that I guess

that they send when you send a message

to the ball right right come on there

that there and it has some messaging

events Alea yelling and then then we

extract an event objects from there and

that has an ID and we have a message and

that message has text and we just get

that text and then we’re gonna have to

figure out a way to just broadcast that

out to everybody who has ever interacted

with the spot ever

until they block the body yeah we’re

trying to keep this simple to just make

this do it woman we have the BART here

we call Stockholm hotline is it’s like a

Facebook user and I’m a Facebook user

and mpj is also chatting with the bots

so if I send LOL stockholm hotline we’ll

send it to mpj it says David says lol so

what’s the first step here the getting

started guide is about getting started

so you should just follow the steps step

one create a Facebook app and Facebook

page alright cool oh I have a bunch of

them choose an existing app No okay what

great new Facebook app ID create contact

email span at Fontbonne function county

and productivity okay set up this T okay

I think that next don’t have a website

and it’s not even in cryptid no test

your Facebook integration no next step

next steps here Shack I think we’re done

entertainment Cosentino from she’s

category performance art I guess with

this yeah I was fictional character no

prefer I like performance art this is

kind of performance art yeah and it is

very difficult to get stuck with this

totally I’m important to things yes

let’s read the true uh I think that we

like the way that me and David know each

other

originally was because we started a

company together we did a small web

agency yeah and I spent so much

time on picking a name yeah do you

remember like the name of the logo

do you remember yeah your tools I am

very very good yeah

laughing the supreme coders the 16 year

old supreme hi Jesus Christ it was

before that it was actually called bucks

or ah yeah all right and me and Eric we

we spent a ton of time uh going to the

pond at the park photographing ducks

because puck is is quite yet what

sweet

so it was a duck themed design it was

very dark and very green because that

was cool we thought that was cool over

like 15 we only want young people to use

this this is our preferred oils yeah I

don’t know what is this for

III think they said we won’t needed a

page so we creating page oh okay okay so

far we’ve done this all right awesome

we’re we’re very being very productive

your Facebook and blah blah blah blah

blah and your page does not have to be

publicly visible oh that’s awesome

ah cause everything’s click add product

select messenger so we’re back to the

app word whereas up here settings

settings also and add that was it had

pop I don’t remember there no another

get started so yes select you pay back

on the con I’m right some of the

permission below her not being approved

for use by Facebook submit for review

okay next on offline no okay are you I

don’t think that we need to do that

though okay fine manage pages this is

really mana okay okay H access token

okay cool like so in case you didn’t

catch what we did there we clicked like

hell on everything and then it worked we

don’t know if it works I’m the product

settings section click on the message

at your web app URL and code for

okay we’re going to do that stuff

validation token that’s not the same

okay I will just kick here alright

Kovach you I guess that’s our server all

right cool

so all right I guess and we’re gonna we

need to set up a server at this point

right now so what are we going to use

we’re going to do something in node

right

I know JavaScript best yeah sure but

like we’re going to use can you use

meteor for this is that suitable I think

we just make a basic a basic node app

yeah and then put it up a modulus all

right cool

so you have to just npm install modulus

something like that all right cool uh I

think it’s pretty cool

Wow showing a lot projects I guess

that’s why make directory so I’m

creating some kind of stockholm

stockholm offline installed modulus it

done all right so what do you do how

does modulus work we need to I guess we

need to make and make this into it some

kind of note happy happy yea-ah

stockholm hotline version one a we leads

to mean less stopped guess sure got

tests and I get repositories should we

create one I guess so the torii and

we’re calling it stop coal line ah

initialize this repository no ignore

node and we’re gonna yes totally it

might be boring yeah I know j-just give

me the code hey wait when can I start :

yeah web development is never and it’s

it’s not a lot of code it’s just tying

things together keywords authors thank

you so much this is everybody gonna

notice how it isn’t doesn’t it cute me

nah you just here yet some random

person uh okay uh we have a package.json

I guess um we need a is perhaps yeah

let’s just switch to that alright so

after J ass I guess we need to find out

or using Express for this is that what

you use nowadays probably this right ah

done okay

getting started I constantly forget how

Express works guide here’s something

that’s great

ah uh I think we’re done all right

so post uh we’re before because this is

Express that they’re showing here I

think you can just deploy it and try to

just get something to log oh that’s

that’s a good idea like yes app dot get

ah ping and yes add function function I

was just now navigating I’m very good

nothing better to type directly type

correctly that’s good hello or we’re

Scott world

type modulus and see what happens with o

there we go and it’s NP J and it’s that

we didn’t have it oh okay and okay there

okay

whoa now create a party not just project

great modulus first alright

oh okay great enter project name but

come on time oh come on line nodejs

enter a servo size in megabytes what I’m

going to do I guess

uh blah okay so now I think we could

just modulus I don’t know if it’s

modulus push to just push yourselves ah

it’s just modulus push okay and deploy

what just a boy oh boy yes well this

really work does it even know how to

start it

because it’s selected it has the package

Jason it knows it’s a node project yeah

sure but I don’t think we we don’t think

we have like the start thing in the node

I think it would work anyways how how

that’s because modulus are built from

out yeah sure but we see yeah I I don’t

think this will work

exciting it’s done its run how can it be

running I think this is less built for

node yeah but we haven’t specified yeah

exactly

okay alright nobody because I reckon

check the logs yeah oh modulus ah

doesn’t even listen okay is that what

you’re saying yeah it doesn’t it doesn’t

do anything it doesn’t hear anything

yes ah okay so it’s love the main fault

but I found looking for AHA and a CI yes

it was looking for no running come on

node up Jessica yeah but it doesn’t even

do anything so just listen I am some

port all right all right Grayson how do

you tap at listen perhaps I have no idea

listen for it oh if it’s not like on

Heroku another services you tend to like

have a environment variable that you

need to pass in here hmm

you can set that up in the web interface

I know if we want to send variable but

I’m pretty sure they have some kind of

they have some getting started can you

video athletes and process and pour’d

process ample right awesome

is there anything else we need to think

about no no I don’t think so no we’re

done named a top Gaea

so this is fun like we actually have the

wrong here and they still figure out

that’s fun

okay let’s keep it that way because it’s

fun yeah thanks I modulus thank you

modulus not sponsored redeploy every

deployed all right a modulus deploy

it’s done no we have to try it see all

right all right let’s go to that slash

hello yes yes yes Oh flat Club special

Oh like oh yeah hello internals aware

okay so how do not do bad not and then

just later

moneyless logs yes why does it always

ask that ah

rest is not fine okay rest is not

defined

deploy your let it deploy yeah and after

so Chloe we can start modifying the cold

again yeah let’s assume this works white

to care right so what should we do more

this is the worst okay ah let’s see what

add that and add the validation talking

into it so this is really yeah I – token

that we have okay cool

so we add that and we we have a

validation token right so yeah somewhere

in one of those tabs this is there no no

that’s a waste validation tool has set

up web hooks I think all right

ah goodbye token for that one validation

hey verify token what is verify token

hmm I don’t know a validation to open

something different

no got mine what is this um enter a

verify token and select message

deliveries haha so we should create our

own okay this is Justin okay this is

your son shared secret that we will now

be sharing with everybody watching you

should have there’s a crab book callback

yeah well hook okay and we’re calling it

super Krete and this we want everything

yeah problem where if I say but this is

secure callback HTTP what is this

district I guess that they have let’s

just go for it

what is it native Amer oh the earth

couldn’t be validated callback

verification failed with its 404 okay

guru HTTP modulus uh we can just try it

yeah um so will this you work yeah yeah

it’s working now what ah but what does

it work with HTTP or not yes it does it

does I think it’s our web hook that is

not it so check the logs ah

alright yeah because it right

Oh sauce yeah right I think you could

afford that all right uh Mars

okay surest race is not no but no beer

we do it we don’t output anything so

just run off doesn’t add anything so we

need to maybe get lamb hook oh we need

to add the validation to Afghans well

probably oh I’ll just create the super

secret maybe right okay back on I’m

gonna reboot this now we’re having a lot

of trouble with the keyboard so David is

a way trying to find some batteries

you better organs you if that helps all

right so we’re back yeah batteries can

you we had to buy some we’re out like

this is this whole recording we also

bought some soda

this whole recording is mmm insanely

improvised I had to just show you how

this looks okay so I forgot this camera

I forgot the charger for this camera so

we wouldn’t be able to use it for the

duration of this um this shoot so we

have mounted my iPhone like this because

it is a pretty good camera dock and we

bought these lamps and we also

soundproof the room with a big mattress

over there and a drape over there it’s

all it’s Robbie we’re pretty satisfied

actually does this matter we just direct

my solution and have these in any

direction

no is this wrong right I think it’s

right it’s alive its alive

okay so where were we

we are idea no idea okay we uh why don’t

we why don’t we switch me let me be

navigator we we were creating a bond we

were our goal is currently to get the

webhook working all right that we got a

404 on the facebook web book it was not

said it wasn’t receiving us I think so –

I try that again just I think that yeah

but

I think that if that because it’s it’s

attempting to access the hook right now

so I think I need to move left ah yeah

yeah yeah update the secret right no I

think that that was not a problem

because right it says 404 not found and

if we look at the code yes you’ve

actually looked at girls before yes I

changed it now before we like with the

batteries and stuff but before it says

it’s had a slash yes after the webhook

which means that it wouldn’t like you

would not do it’s trying to access just

webhook without the slash so I think

that if we just update it now I think

that we it will be another error but we

could also do this as well yes yes super

for sure no it was – they closed – okay

okay I hope the best memory that’s a lie

no no no we’re ready I’m ready to kick

like really this should like we’re

probably doing something wrong perhaps

is there index J yeah no I think they’re

doing something wrong I think that web

development is doing something wrong I

am this is still uploading the complete

that vailable it up loading from thank

you from where

yeah from us to them like maybe it

should be noted that viber yeah we are

we are 100 and megabit fiber here o

wired let’s do it yeah boom very fine

safe yes

go alright clown all right uh where so

what’s next the getting started right

getting started guide back to that ah a

cure would add a code for verification

the code should against that we did that

we did the verify and save yeah so we

did this we’re done now around three

yeah okay so we we need to get the

refuge here somewhere yeah okay

I think that this is just only one of

the tabs has that access token we have

generated that one so as you go back to

the yeah the this yeah uh yeah just

select that page with the PR where is it

yeah there there there there

so come online and that’s again that’s a

that’s a token that we need is it all

right Scott yeah so and where should I

put this yeah I’m not sure like go back

to the getting started page getting

started yet paychecks is token okay

subscribe the apt the page using the

page access okay you need to start

create a new document and the pace the

access token in there there yes or no

type of a ground okay and then go back

to that page where we just where and pay

copy that and paste that in and we need

I think that at the end there’s a space

for it token got it and then we replace

that yeah token with exactly and then

you just execute this curve come on and

this will subscribe room what happened

they do got nothing success true sounds

good

yes okay let’s go for it fine receive

messages you are listening for post

should just do this yeah I guess do it

out of okay go back to the app yes yes

yeah because that one is the one but

above on line eight that’s that’s the

verify exactly that’s just to get so we

can just paste this in this is just what

to do the things we want to do that’s a

great comment go to everyone when we

come back in a couple of months time

yeah we will understand the text message

from this sender so should we do

something with this like output it or

its console.log it for now

console dot log text I will add a

semicolon here even though you I don’t

hate them

ah here okay say should we read it for

this is redeploy it and then we can keep

on reading that boom so how do we go to

your Facebook page and send a message to

it oh okay let’s do that then you should

be able to you’re signed in yeah no it’s

the Facebook page is somewhere well the

report anything we called it that’s

common offline yeah can we go through

that yeah performers art awesome 1000

people talking about this already

nice uh wonder what SOCOM hotline is I

think that’s the thing no slows

this is a canopy probably entry of

undefined what is that what is undefined

it it says can happy last 19 okay let’s

and we have undefined so excited okay so

body is on all right because this is

probably sending JSON yeah and we are

not parsing this as JSON

they probably if others we should just

convert it to JSON yeah but we don’t

there’s a plug-in for app for for

Express for this just Google Express

JSON Express Jason let’s do know this

was not a 404 before there this one know

that under done that body parts are body

part this is the one this is one I want

this is one I do this NPM means either

there you just do like this yeah but do

it with the – just save so it’s added to

the package.json file if you don’t know

this you should if you add – – save –

you MPM install it’s automatically added

to your packaged of JSON I didn’t know

that I always open the package JSON yeah

super handy super handy and then we need

to do that thing just add that yeah I

think yeah and then I think that you

there’s an install thing somewhere

somewhere ah where’s the getting started

yeah we go here we go Daffy Duck use

there there this one yes yes that is

what we want so so what happens when we

do this do you mean app dot I think that

if if a client sends JSON it will

automatically parse that as JSON so this

should be separate from our yeah

whatever whatever do yeah it’s just

adding this yes this is middleware like

that yes say so what this does is that

it installs the

reporter JSON middleware into Express

I’ll show that it gets first dibs on how

to request and is allowed when it sees

something that looks like Jason it will

just promise it exactly and then like

feed that at like 22 here it will feed

that as pours like a finished object so

you think that we could just like

redeploy this and it should work yes

is there a way for us to not have to

deploy it to test it so we could just

test it locally instead I think we just

could but we need to fix the package of

JSON thing because right now it’s

pointing to index J s which modulus is

magically by dancing yeah just and just

try and be in start can we do that mm-hm

missing script start okay yes add a

script start then now in the scripts

cool right you need to open a new tab in

the terminal I think I split the pea

close split thing goes how do I open a

new tab it come on Tee tee all right ah

and just curl to it how do you do no

because it’s listening on that

environment but go to app J s FJ yes

here we go

yeah ash line mmm if you look at line 36

it’s gonna do this process and port

thing and if we don’t have it we add

something else yeah I think that’s

easier we creep around yeah we could

pass it in as an environment variable

too but that this is easier so save yeah

and then we run it again you like that

and then we should be able to curl it

like that and 3,000 or just yeah I think

that’s can we do it I never learned I

don’t get that yeah which makes sense

yeah do the test yeah but it’s not test

it’s something else hello hello

yeah yeah cool it works okay so and now

we want to try to post some kind of JSON

stuff how like post yeah yes Google curl

JSON curl Jason how to post data – did I

use this command oh my god ah okay there

and we do this to our web hook whom we

get some undefined yeah because we’re

not posting the payload it expects oh

you think nothing so yeah how do you

think it yeah because it’s not the same

error so this is you mean that this is

good because it’s another error then

from there I would say so yes what is

there it’s a very proper to zero of

undefined on up J is up KS 22 I think

that’s where we’re reading the stuffs

isn’t it is this is saying no look it’s

a body is an object now but I am so

worried or something so this is this is

good yeah trying to read the first index

yeah okay yes for fun just define entry

as an array like in your curly benefit

card and define hmm he wants an entry

property and that expects it to be an

array and the first I don’t have a

masculine objects with a property

messaging which should have some lols

come on yeah exactly

and now yeah you try this yes now we

should get the error that it shouldn’t

Aaron like 43 I think 25 5 good oh how

we get there or here alright it working

deploy boom

so let’s continue with with the tutorial

yeah well that’s why it was only that

one we right now don’t need that one we

don’t need that one we don’t need that

oh oh all right so when is deployed we

should be able to send a text message

yeah and see it in logs mmm so perfect

message provisioning and deploying

bundles to servos hello this is

stockholm calling the hotlines

okay I know this is misspelled don’t

bother

alright so now we should check the logs

yeah yeah yeah but something yes coming

here it should know yes woot BAM

okay uh so okay now we need you see that

it got the hello as well the previous

text yeah so did resend that no I guess

it worked

yeah automated with when we sent the

hello

yeah the app wasn’t oh yeah so only

somehow it’s a bigot yeah awesome that’s

cool okay she’s got a friend request

here yeah it’s probably some person uh I

I don’t I – I’d around him

yeah I don’t know I don’t I don’t please

okay next step um text message boom boom

boom let’s modify webhook to echo

messages back alright always a function

that we sent back to text message with

whatever words this is excellent this is

good this is that isn’t this exactly

what we want to do yeah but to everyone

okay uh well that’s the difference yeah

so but this is a good good step on the

way

so I guess token is that the one we use

no paychecks is token is the curl token

from the card it might be if you look at

yes it’s the token prom curl so yes yes

paste this in replace the comment above

with which is accountable

I don’t know what is up but yeah yeah I

think that is yes I think that we we can

figure it out

should we just yeah add the codes yes

where yes that’s fine and the access

token we had that here here here yes so

I would copy the act the page as well

yes toka missed in there like that ah I

think it’s here we want the one year as

to add the code yeah good play

place the comment with yeah we can

quickly console.log well yeah that’s

fine so what is that sound text message

we just created this function simply

watches with the sender and some text

what is sender sender is it what is it

getting that much sender okay it’s reads

okay under ID alright so this is

basically an unique ID for the person

sending the message so later on for us

we would have to store all the sender’s

IDs somewhere to be able to yes to

dispatch all the messages to all the

ideas yeah I’m thinking it way we have

to have a database maybe may maybe we

can remember it we could keep it in

memory of that that’s that’s dirty but

it works we can write right we can do

that first at least I don’t think that

we will have time for more

so okay we save it we try to deploy it

again and then we keep on following the

instructions here yeah I think I think

that this should I think we really close

to done actually I dear Stockholm

hotline I sincerely hope you will echo

this

the letter back to me father is well the

form is doing okay Orvis wasn’t very

good at this wonder you’re busy I fall

for what / summer yeah you don’t this

eat this this year

here here this Europe the uploading of

the build is soon completed yeah Jesus

we can write a letter I tell everyone we

are healthy and well modulus you should

not be able to write letters this long

while you’re doing deployment completing

pill what how could that I just realized

this so so I often watch MPGs videos on

them on my mobile phone which is like a

4-inch phone oh this will be super tiny

this will be very tiny and so please I

will excuse to make an excuse to myself

that I made this so tiny

okay so honest yeah damn it I was

expecting or something chef yes okay

locks locks locks locks oh no sir

request is not a fine yeah probably

what do you mean no it’s probably we

just haven’t defined it we haven’t

defined it in the decider so what now

request oh yeah yeah because it’s used

in some some library okay so what is

request its they are using some kind of

request library I think it’s just just

check in there example there probably

perhaps in the beginning something we

skipped yes do okay I think that this is

just the NPM package that is called

request so yes go npm install say

request – just save yeah yes I think

that will be and then we should require

it

requests yeah require yes cool so we

just try to run locally or just yes

go sure

dammit yes what is switch what is

happening now everything seems fine here

Ronin command and p.m. start yeah it

seems fine which we specified but it’s

not even logging it out you’re right

so did this week when we added the

request stuff did it do something in our

code that somehow took over maybe so it

could it be that it never Oh perhaps we

should it’s not doing like we should it

should print the text before this fails

so yeah whatever yes it should let’s

check the logs again perhaps it’s okay

it’s not something happy yeah it’s

printing them did it perhaps was he just

like yes boom

okay all right that’s awesome

umm we need to okay we need to send this

out or whenever a sender connects

whenever a sender sends a message we

need to add that too you do that how I

connect my place rules yes my facebook

ah I think that I might need to add you

to this page no I will I will add myself

to them yeah but can you can find it or

whatever like oh you mean that it’s not

pop yeah exactly it’s not public

do you find it ok cool oh great it was

me from other side okay awesome

this works so because so this this so

because is we are the Facebook page so

we get a notification that someone is

sending something to us that’s why we we

get this one but now we want to have the

thing that I sent from my laptop over

here to get echoed back here to all

subscribers to the Stockholm hot line

chat all right cool

we want to store okay let me show here

these IDs you want to store them all

right all right so with them going to

send it out to all the IDS that are now

on the chat alright so this is the web

hook where we’re getting the we need to

save at this point right forever oh you

can get several messages here yeah

because it bursts the two messages yeah

so okay so for every time we need to

like our old Sanders yeah just great

okay like a hash table yeah then sender

and I’m gonna sign a oh sorry all all

Sanders yeah and true right so it’s it’s

a hash table with people that our

senders okay and then we just loop them

and then yeah should we clear them so at

some time or should we just make it two

it would be a lot of Sanders there

because you can’t be huge yeah exactly

yeah but sit let’s let the nature of the

app and yeah so what I’m sorry how do we

how would we victim like yeah I don’t

know because what I’m saying is that

will we end up with having 1 million

Sanders yes we would yeah well until the

app restarts it’s just in memory for now

yeah but when we know that they’re false

so we don’t start to send to all we

could we could just you know add a date

date time here

okay okay let’s do it that that’s can we

do that later okay we do it later

yeah we will never do that ah all

senders and then we need to like do this

for every Center right so awesome like

how do you do this of your keys right

what you want to do I’m going through

the the properties of all the senders

yeah so and so now this will be an array

of all the IDS just eat for each email

nice and then right you can call that

sender ID that’s more clear because it’s

just yeah I never lie I’m gonna call

this an ID as well now you know that

we’re using it later on right yeah we’ve

gone up like because but this will hide

this one okay yeah sure so we’re gone

all right yeah it’s now recruits and

writing sender ID I’m gonna call it send

Rodrik every weren’t it great move this

segment in no no no thank you just to

wrap it around the same text message

because it’s like young one message is

coming yeah everyone yes just yes

through all the centroid ease and send

it to all of them not just the one that

message so this is strong you know what

we want to look at everyone but the one

that sent a message oh that’s a good

point that’s a good point

all right Justin if ah yes no do like

this loop it through all the sender’s

yeah and then we add this sender to the

ID clever boy all right

so we do that but then again no because

that will work that would only work the

first time

okay so all right just send it to

everyone yeah that’s true that’s good

just to confirm that that will be

working good

I don’t call it sender

and whereas in sender IDs and recently

hang on this thing where is this this is

gonna be I’m gonna do that I think this

is good right working go wrong what can

go wrong let’s deploy it no not logs

dammit alright deploy so check the enter

boom boom ok let’s let’s just why we’re

uploading yeah again we will check the

code all right

so oh so we are getting the event here

that’s not changed we are assigning the

sender ID to a bar that bar is that

Sandra making sure that the sender idea

it is in the in this hash table here and

it’s just called true to just you have

any value and then if the event has a

message they’ll text I opened it I’m

okay maybe there’s a chance right the

message can probably have a lot of other

properties yeah like some like an image

or something so annoyed that they are

assigning this to ah and then we just

console.log the text and then send it to

awesome this should work now yeah and

we’re running so so so I would write on

my computer

yeah I’m gonna check here so let me just

write something something did not work

nothing happened so check the loss yeah

it it received it but didn’t send it to

ever

no because this has not been added yet

yeah but so didn’t know because this was

the fourth Pokemon I received something

yeah yeah but that makes sense but this

client yeah but I didn’t get it back on

my computer either no but that makes

sense why because you’re added to your

attitude sender array yeah our sender

the sender all senders object you’re

only added here when you send a message

and this code did not did not exist when

the other people sent there

messages yes but when I sent ya the

message should have been come here

Sandra Dee is me I’m a dead yeah oh yeah

for some reason this doesn’t work so I

think it’s this code that might fail are

we sure on this like I don’t

something is failing working okay just

okay we don’t care about the text yeah

we care about to tell ya we do and then

we console.log this also yeah just to

see what’s going on or could be that it

was just slow so if we send again

something again stock more to receive

the message from me

yeah but nothing’s happening it’s not

happening anything somebody watching

this is now like they are so stupid for

now it’s online yeah all right we just

sent something it send something all

right send it here and we go like hello

hats don’t have to spare it no okay

check there okay whoa whoa it worked did

it work there – no yes no because that’s

not yet in the sender area no no has

that’s not why is it huh

hello from Dave can be something that is

not the public app it does receive the

messages yeah exactly and it gives you

sign in a Stockholm hotline itself yeah

could it be somehow that is not public

because this is echoing it back okay

just output the logs now because you

have it you have the flag there so you

are the page you’re talking to yourself

exactly perhaps it’s some kind of okay

so it’s my messages aren’t there so no

so that’s yeah hello from David yeah I’m

writing here hello from David yeah I’m

chasing this sorry yeah I’m there and we

see it Long’s and it’s not that there

it’s not there so for some reason my ID

is not there perhaps because I think

it’s somehow it’s not published yeah

it’s not treating it’s not public

perhaps we need to make you an admin or

something that was tricky ah right

friend I did that

oh you did that okay go back go back

though in this case you will be able to

message only app admins you can also

just yeah you will also do we need to

make an admin where’s I mean I hear add

there so you mean that now

yeah you need to accept the invitation

on your computer confirm I can affirm it

I mean so now reload here you should say

that so I’m an admin oh okay I will type

awesome so our code is working now we

expect to see here in the logs two ideas

two IDs boom

yes it’s mpj and then hello from David

is from Lee so here my ID was added yeah

sweet so we’re done now uh this is not

public yeah because I think that

Facebook needs to review it

I guess ah we will try to fix this up

and and make it like so that Facebook

approves it I’m making no promises

because this is a really stupid up and

they might not approve it but we’ll try

alright that’s it we accomplished our

mission and you have watched an episode

of fun fun function I release new

episodes of this show every Monday

morning so make sure that you don’t miss

the next one if you like this one

subscribe down below if you don’t want

to wait that long you can check out one

of the older episodes here or here IM

mpj baby until next Monday morning stay

curious

okay no it just open an AHA

yes to take a stop down how hard it is ah

Please follow and like us: