timercommands.py 文件源码

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

项目:PomodoroBot 作者: VicenteRD 项目源码 文件源码
def timer_stop(self, ctx: commands.Context):
        """ Stops the timer, if it's running.
            Resets the current period and time, but keeps the setup.
        """

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

        interface = self.bot.get_interface(channel)
        if interface.timer.stop():
            send = "Timer will stop soon."
            await self.bot.say(send, delete_after=interface.timer.step)

        else:
            await self.bot.remove_messages(channel)

            send = "Timer has stopped."
            await self.bot.say(send, tts=interface.tts)

        lib.log(send, channel_id=channel.id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号