Archived
1
0
Fork 0

Update su_utils.py

This commit is contained in:
多羅狼 2023-12-07 09:26:23 +08:00 committed by GitHub
parent 09370cf6b8
commit db06a3d09b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,8 +144,21 @@ async def _(msg: Bot.MessageSession):
await msg.finish([Plain(result), Image(path)])
set_ = module('set', required_superuser=True, base=True)
purge = module('set', required_superuser=True, base=True)
@purge.command()
async def _(msg: Bot.MessageSession):
cache_path = os.path.abspath(Config('cache_path'))
if os.path.exists(cache_path):
shutil.rmtree(cache_path)
os.mkdir(cache_path)
await msg.finish(msg.locale.t("core.message.purge.success"))
else:
os.mkdir(cache_path)
await msg.finish(msg.locale.t("core.message.purge.empty"))
set_ = module('set', required_superuser=True, base=True)
@set_.command('modules <target_id> <modules> ...')
async def _(msg: Bot.MessageSession):