admin.py 文件源码

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

项目:PomodoroBot 作者: VicenteRD 项目源码 文件源码
def admin_shutdown(self, ctx: commands.Context):
        """ Exits the program. Administrator only!
        """

        lib.log("Shutting down...")
        await self.bot.say("Hope I did well, bye!")

        for channel, timer in self.bot.valid_timers().items():
            if timer.get_state() != State.STOPPED:
                timer.stop()
                if lib.get_channel(ctx) != channel:
                    await self.bot.safe_send(
                        channel,
                        "I'm sorry, I have to go. See you later!"
                    )

                    await self.bot.remove_messages(channel)
        self.bot.unsub_all()

        await self.bot.logout()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号