def channel_has_timer(ctx: commands.Context) -> bool:
""" Checks if a channel has a valid timer set.
: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 : "timer not found"
"""
if isinstance(ctx.bot, PomodoroBot):
channel = ctx.bot.spoof(ctx.message.author, lib.get_channel(ctx))
if ctx.bot.get_interface(channel).timer is not None:
return True
raise commands.CheckFailure(message="timer not found")
评论列表
文章目录