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.")
评论列表
文章目录