https://discord.gg/botpress logo
hey so suppose i am running an API call
# 🌎general
c
hey so suppose i am running an API call in that custom block. ( I am doing it in an async function like you suggested) now the condition to transition is that if the
bookingConfResp
workflow variable is NOT empty then we proceed (basically waiting for the API response to come back) but what happens till the time its empty? will the conversation abruptly stop here or actually wait for the API response? https://cdn.discordapp.com/attachments/1108396291060408352/1277158341008822367/image.png?ex=66cc25e4&is=66cad464&hm=ad496cf7c09fecf6271e0db65362271ba69303975dc48385afa305b268e692b5&
w
yep it will get stuck so i suggest you to add a code card after the one with the api call and ask the botpress ai to 'wait for 2 seconds' so the workflow variable will be proccessed and never be empty
c
wait AI in code card?
we can access the AI agent through a code card aswell?
it should be 9 am - 5pm
it works apparently when i took your suggestion to add it into an async block and await the response
w
no i mean the AI that helps you to create code^^
c
ohh
thats ok im fine with programming
i do use it at times and its pretty handy
w
nice!
yes for sure 😂
c
😹
w
maybe this will help
c
thanks i will look into it. Appreciate your time and help 💯
w
i think it will be the same problem though...
c
oh
i can give you an example scenario of what im trying to do
w
because it seems to be the same way as you did
c
so basically , the office is located in suppose france lol and the user accessing this is in usa suppose i have programmed the timings for office hours to be 9 am to 5 pm in local (france) time but for the user who is in like NYC/usa will need to see the timings in their zone
but the problem is detecting their zone lol
for the rest i can just convert the timings depending on which zone a user is in
apparently JavaScript code that runs in browser (basically in the user side) can detect timezones etc. but im not sure how botpress deals with it
w
yeah yeah i see what you want to do there's lot of things that are working in the studio (because it's just a webpage after all, with all the default librairies in) but not in the webchat
c
yeah right
w
me neither
c
the webchat embed is probably different (like the libraries it has access to)
w
yep, just the three by default
c
wait the three includes which ones?
w
but i'm pretty sure that if you build a custom integration it will work
c
oh
w
axios, luxon and another one for text formatting i believe
c
if luxon is there then it shouldnt be an issue
since luxon can detect timezones
w
but that's a lot for just this featuree, that's the problem
c
ye
w
yeah i agree
c
i'll see what i can do, its not that hard of a problem lol
thank you again for the help!
w
you're welcome !