|
@@ -263,11 +263,32 @@ def message_text(event):
|
|
|
return
|
|
|
|
|
|
if event.message.text=='關鍵字歷史走勢':
|
|
|
- out_result = get_hotkeys(True)
|
|
|
-
|
|
|
- line_bot_api.reply_message(
|
|
|
- event.reply_token,
|
|
|
- TextSendMessage(text=out_result))
|
|
|
+ js=json.load(open('test.json','r',encoding='utf-8'))
|
|
|
+ keys = get_hotkeys(past=True)
|
|
|
+ num = 1
|
|
|
+ for k in keys:
|
|
|
+ row_dict = {}
|
|
|
+ row_dict['type'] = 'box'
|
|
|
+ row_dict['layout'] = 'baseline'
|
|
|
+ row_dict['contents']= [
|
|
|
+ {
|
|
|
+ "type": "text",
|
|
|
+ "text": "第"+str(num)+"名",
|
|
|
+ "size": "sm",
|
|
|
+ "color": "#aaaaaa",
|
|
|
+ "flex": 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "text",
|
|
|
+ "text": k,
|
|
|
+ "flex": 5,
|
|
|
+ "weight": "regular"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ num = num + 1
|
|
|
+ js['body']['contents'] = js['body']['contents'] + [row_dict]
|
|
|
+ line_bot_api.reply_message(event.reply_token, FlexSendMessage('ChoozMo',js))
|
|
|
+ return
|
|
|
|
|
|
if event.message.text == '叫':
|
|
|
line_bot_api.reply_message(
|