def is_owner(user: discord.User):
""" Return true if user/member is the assigned bot owner.
:param user: discord.User, discord.Member or a str representing the user's ID.
:raises: TypeError: user is wrong type.
"""
if isinstance(user, discord.User):
user = user.id
elif type(user) is not str:
raise TypeError("member must be an instance of discord.User or a str representing the user's ID.")
if user == owner_cfg.data:
return True
return False
评论列表
文章目录