I am building a bot for Hangouts Chat. My bot will display a random image from a free image api. The api's URL is the same URL on each call but will get a new image. Unfortunately, my bot will not update the image. It just repost the same image on each call. I am using Google's App Script to deploy the bot. My image code is as follows:
function buildImageCard(url) {
return {
cards: [
{
sections: [
{
widgets: [
{
image: {
imageUrl: url
}
}
]
}
]
}
]
};
}
The random image shows up just like it should. The only issue is when I wan to call it again, it shows the same image. I can't seem to find a way to refresh the card. I have seen this method:
actionResponse: {type: shouldUpdate ? 'UPDATE_MESSAGE' : 'NEW_MESSAGE'},
Then pass shouldUpdate
to buildImageCard
. Although, nothing happens if shouldUpdate
is true. What am I missing?