yuripeyamashita
commited on
Commit
•
4caed3e
1
Parent(s):
7893664
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,9 @@ def send_text(token, text):
|
|
64 |
})
|
65 |
|
66 |
def get_username(payload):
|
67 |
-
|
|
|
|
|
68 |
try:
|
69 |
res_json = requests.get(url, headers={"Authorization": "Bearer " + LINE_CHANNEL_ACCESS_TOKEN}).json()
|
70 |
return res_json.get("displayName")
|
|
|
64 |
})
|
65 |
|
66 |
def get_username(payload):
|
67 |
+
group_id = payload.get("group_id")
|
68 |
+
user_id = payload.get("user_id")
|
69 |
+
url = f"https://api.line.me/v2/bot/group/{group_id}/member/{user_id}"
|
70 |
try:
|
71 |
res_json = requests.get(url, headers={"Authorization": "Bearer " + LINE_CHANNEL_ACCESS_TOKEN}).json()
|
72 |
return res_json.get("displayName")
|