def timer_reset(self, ctx: commands.Context):
""" Resets the timer setup.
"""
channel = self.bot.spoof(ctx.message.author, lib.get_channel(ctx))
interface = self.bot.get_interface(channel)
if interface.timer.get_state() == State.STOPPED:
interface.timer.set_state(None)
interface.timer = None
interface.time_message = None
interface.list_message = None
log = lib.get_author_name(ctx) + " reset the timer."
send = "Successfully reset session configuration."
else:
log = (lib.get_author_name(ctx) + " tried resetting a timer that "
"was running or paused.")
send = "Cannot do that while the timer is not stopped."
lib.log(log, channel_id=channel.id)
await self.bot.say(send, delete_after=self.bot.ans_lifespan)
评论列表
文章目录