Fallback to real_name
s if a user has no display_name
This commit is contained in:
parent
c8cb828b70
commit
889fd9be49
1 changed files with 4 additions and 1 deletions
5
main.py
5
main.py
|
@ -50,7 +50,10 @@ except ImportError:
|
||||||
userMappings[f"<@{user['id']}>"] = (
|
userMappings[f"<@{user['id']}>"] = (
|
||||||
f"<@{user['profile']['display_name']}>"
|
f"<@{user['profile']['display_name']}>"
|
||||||
if user["profile"]["display_name"]
|
if user["profile"]["display_name"]
|
||||||
else f"<@{user['id']}>"
|
else (
|
||||||
|
f"<@{user['profile']['real_name']}>"
|
||||||
|
if user["profile"]["real_name"]
|
||||||
|
else f"<@{user['id']}>")
|
||||||
)
|
)
|
||||||
print("All mappings generated, writing cache file now...")
|
print("All mappings generated, writing cache file now...")
|
||||||
with open("cache.py", "w") as cacheFile:
|
with open("cache.py", "w") as cacheFile:
|
||||||
|
|
Loading…
Reference in a new issue