gsheets.py 文件源码

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

项目:Tobo-Cogs 作者: Tobotimus 项目源码 文件源码
def removesheet(self, ctx: commands.Context, name: str):
        """Remove a sheet which has been added.
        Arguments:
         - <name> The name of the sheet to remove"""
        scopes = (ctx.message.channel.id,
                  ctx.message.server.id,
                  GLOBAL)
        for scope in scopes:
            try:
                self.sheets[scope].pop(name)
            except:
                pass
            else:
                dataIO.save_json(SHEETS_PATH, self.sheets)
                await self.bot.say("The sheet has been removed.")
                return
        await self.bot.say("Couldn't find a sheet with that name in your scope.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号