yuripeyamashita commited on
Commit
d1db829
1 Parent(s): 9497451

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -22,6 +22,7 @@ def api():
22
  global message_list
23
  try:
24
  payload = get_payload_dict(request.get_json())
 
25
 
26
  # if payload.get("group_id") != GROUP_ID:
27
  # raise ValueError("Invalid Group")
@@ -145,8 +146,8 @@ def api():
145
  print(f"An error occurred: {e}")
146
 
147
  print("="*20)
148
- for item in message_list:
149
- print(item)
150
  print("="*20, end="\n\n")
151
 
152
  return "", 200
@@ -156,9 +157,7 @@ def get_payload_dict(raw_payload) -> dict:
156
  # print(raw_payload)
157
  global group_id
158
  events = raw_payload.get("events", [{}])[0]
159
-
160
  group_id = events.get("source", {}).get("groupId")
161
- print(group_id)
162
 
163
  return {"token": events.get("replyToken"),
164
  "quote_token": events.get("message", {}).get("quoteToken"),
@@ -367,7 +366,7 @@ def get_checkout_bubble(checkout_list: list):
367
  "size": "sm",
368
  "color": "#111111",
369
  "align": "end"
370
- }
371
  ],
372
  "margin": "sm"
373
  })
 
22
  global message_list
23
  try:
24
  payload = get_payload_dict(request.get_json())
25
+ print(group_id)
26
 
27
  # if payload.get("group_id") != GROUP_ID:
28
  # raise ValueError("Invalid Group")
 
146
  print(f"An error occurred: {e}")
147
 
148
  print("="*20)
149
+ for key in message_list:
150
+ print(message_list[key])
151
  print("="*20, end="\n\n")
152
 
153
  return "", 200
 
157
  # print(raw_payload)
158
  global group_id
159
  events = raw_payload.get("events", [{}])[0]
 
160
  group_id = events.get("source", {}).get("groupId")
 
161
 
162
  return {"token": events.get("replyToken"),
163
  "quote_token": events.get("message", {}).get("quoteToken"),
 
366
  "size": "sm",
367
  "color": "#111111",
368
  "align": "end"
369
+ }
370
  ],
371
  "margin": "sm"
372
  })