Template code of line customed reply message(flex message).
from customer_template import create_customer_template
for example:
# this is the demo code of line message api
.
.
.
# handle a event which receive a text msg
@handler.add(MessageEvent, message=TextMessage)
def handle_message(event):
msg = event.message.text
print('【receive type】', event.message.type)
print('【text content】', msg)
if msg == "娛樂":
customer_template = create_customer_template()
line_bot_api.reply_message(event.reply_token, customer_template)
return