timercommands.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:PomodoroBot 作者: VicenteRD 项目源码 文件源码
def timer_superreset(self, ctx: commands.Context):
        """ Ignores all conditions and resets the channel's timer.
            Requires elevated permissions.
        """

        channel = self.bot.spoof(ctx.message.author, lib.get_channel(ctx))

        interface = self.bot.get_interface(channel)
        if interface.timer.get_state() == State.RUNNING:
            self.bot.timers_running -= 1
            await self.bot.update_status()

        await self.bot.remove_messages(channel)

        interface.timer = None

        lib.log("Successfully forced a reset on this channel's timer.",
                channel_id=channel.id)
        await self.bot.say("Timer has been force-reset",
                           delete_after=self.bot.ans_lifespan)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号