Update app.py
Browse files
app.py
CHANGED
@@ -45,11 +45,17 @@ def api():
|
|
45 |
matrix = [[0 for _ in range(len(users))] for _ in range(len(users))]
|
46 |
print(matrix)
|
47 |
|
48 |
-
for msg_id in message_list:
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
52 |
|
|
|
53 |
# username_list = get_username_list()
|
54 |
# print(username_list)
|
55 |
# for user_id in username_list:
|
|
|
45 |
matrix = [[0 for _ in range(len(users))] for _ in range(len(users))]
|
46 |
print(matrix)
|
47 |
|
48 |
+
for msg_id, data in message_list.items():
|
49 |
+
quoted_msg_id = data.get("quoted_msg_id")
|
50 |
+
quoted_number = len([key for key, value in message_list.items() if value.get("quoted_msg_id") == msg_id])
|
51 |
+
if not quoted_msg_id and quoted_number == 0: # 要平分的情況
|
52 |
+
to = users.index(data.get("user_id"))
|
53 |
+
for row in matrix:
|
54 |
+
row[to] += (data.get("amount") / users_number)
|
55 |
|
56 |
+
print(matrix)
|
57 |
|
58 |
+
# users.index("b")
|
59 |
# username_list = get_username_list()
|
60 |
# print(username_list)
|
61 |
# for user_id in username_list:
|