Improved typing

This commit is contained in:
Profitroll 2023-05-08 16:39:46 +02:00
parent 42b4578d36
commit 967d5e981e

View File

@ -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: