yuripeyamashita
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,8 @@ def api():
|
|
22 |
try:
|
23 |
payload = get_payload_dict(request.get_json())
|
24 |
|
25 |
-
if payload.get("group_id") != GROUP_ID:
|
26 |
-
|
27 |
|
28 |
if payload.get("unsend_msg_id"):
|
29 |
unsend_msg_id = payload.get("unsend_msg_id")
|
@@ -93,14 +93,14 @@ def api():
|
|
93 |
if amount < 0:
|
94 |
result.append({"from": get_username(users[j]), "to": get_username(users[i]), "amount": -amount})
|
95 |
|
96 |
-
|
|
|
97 |
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
send_flex_text(payload.get("token"), bubble)
|
104 |
|
105 |
raise ValueError("Action Success")
|
106 |
|
|
|
22 |
try:
|
23 |
payload = get_payload_dict(request.get_json())
|
24 |
|
25 |
+
# if payload.get("group_id") != GROUP_ID:
|
26 |
+
# raise ValueError("Invalid Group")
|
27 |
|
28 |
if payload.get("unsend_msg_id"):
|
29 |
unsend_msg_id = payload.get("unsend_msg_id")
|
|
|
93 |
if amount < 0:
|
94 |
result.append({"from": get_username(users[j]), "to": get_username(users[i]), "amount": -amount})
|
95 |
|
96 |
+
if result:
|
97 |
+
sorted_result = sorted(result, key=lambda x: x["from"])
|
98 |
|
99 |
+
for r in sorted_result:
|
100 |
+
print(r)
|
101 |
|
102 |
+
bubble = get_checkout_bubble(sorted_result)
|
103 |
+
send_flex_text(payload.get("token"), bubble)
|
|
|
104 |
|
105 |
raise ValueError("Action Success")
|
106 |
|