def is_admin(ctx: commands.Context) -> bool:
""" Checks if the author of the command is the administrator / owner
of the bot.
:param ctx: The context to check the command in.
:type ctx: commands.Context
:return: True if the command succeeds, else raises an exception.
:raises: commands.CheckFailure: If the check fails.
message : "not admin"
"""
if isinstance(ctx.bot, PomodoroBot) and \
ctx.bot.is_admin(ctx.message.author):
return True
raise commands.CheckFailure(message="not admin")
评论列表
文章目录