I had the same issue when I posted a valid GIF URL in the generic template. You can see a question I posted and the answer I add after a couple of hours of searching.
Unfortunately, animated GIF images cannot be printed through the generic template yet.
The solution you can do is you create two payloads and not a template. The first payload will post a GIF Image and the second your buttons like,
code
def thanks(req):
your_welcome_gif=[ "https://media3.giphy.com/media/KCw6QUxe9zBO6QNrFe/giphy.gif",
"https://media1.giphy.com/media/H21d4avBXs8B9X0NLj/giphy.gif",
"https://media1.tenor.com/images/15bafc0b414757acab81650a6ff21963/tenor.gif?itemid=11238673"]
greeding = req.get('queryResult').get('parameters').get('greeding')
if greeding == 'Thank you' or greeding == 'thank you' or greeding == 'Thanks' or greeding == 'thanks' or greeding == 'Nice' or greeding == 'nice':
return {"fulfillmentMessages": [
{
'payload': {
"facebook": {
"attachment": {
"type": "image",
"payload":{
"url":random.choice(your_welcome_gif)
}
}
}
}
},
{
'payload': {
"facebook": {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "You're welcome :) \nWould you like to choose another movie?",
"buttons": [
{
"type": "postback",
"title":"Yes",
"payload":"Yes"
},
{
"type": "postback",
"title":"No",
"payload":"No"
}
]
}
}
}
}
}
]}
Here is my question with code uploaded.