Improved typing
This commit is contained in:
parent
42b4578d36
commit
967d5e981e
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user