I'm creating a google hangouts chatbot. I'm building the bot in Google Apps Script. The bot accesses some web apis that usually take a few seconds, but the wait can be disconcerting to the user who doesn't realize the system is not just ignoring them. I want to display a message like "please wait" before the results come in. But the event is triggered by onMessage and text is displayed as part of the return statement. Is there a way to show an immediate message and then the rest of the message when the api responds?
onMessage(event){
text="Please wait, processing...";
#send text to screen
response=UrlFetch(url, params);
return {"text":response['text']}
}