From 967d5e981e545e90e71d28c278f3c984b2793132 Mon Sep 17 00:00:00 2001 From: profitroll Date: Mon, 8 May 2023 16:39:46 +0200 Subject: [PATCH] Improved typing --- modules/utils_sync.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/utils_sync.py b/modules/utils_sync.py index 3b6660f..3f80df6 100644 --- a/modules/utils_sync.py +++ b/modules/utils_sync.py @@ -1,6 +1,6 @@ -from typing import Any +from typing import Any, Union -from discord import Member +from discord import Member, User from ujson import dumps, loads @@ -36,7 +36,9 @@ def config_set_sync(key: str, value: Any, *path: str) -> None: return -def guild_name(member: Member): +def guild_name(member: Union[Member, User]) -> str: + if isinstance(member, User): + return member.name if member.nick == None: return member.name else: