Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/b30/__init__.py

30 lines
1.1 KiB
Python
Raw Normal View History

2021-07-27 16:03:48 +00:00
import os
from core.elements import MessageSession, Plain, Image
2021-10-14 12:22:58 +00:00
from core.decorator import on_command
2021-07-27 16:03:48 +00:00
from .getb30 import getb30
from .initialize import arcb30init
2021-10-15 17:36:22 +00:00
@on_command('b30', help_doc='<friendcode> {查询一个Arcaea用户的b30列表}', developers=['OasisAkari'])
2021-07-27 16:03:48 +00:00
async def main(msg: MessageSession):
assets = os.path.abspath('assets/arcaea')
friendcode = msg.parsed_msg['<friendcode>']
if friendcode:
if friendcode == 'initialize':
2021-09-04 18:08:00 +00:00
if msg.checkSuperUser():
return await arcb30init(msg)
2021-07-27 16:03:48 +00:00
else:
return await msg.sendMessage('权限不足')
2021-07-27 16:03:48 +00:00
else:
if not os.path.exists(assets):
resp = {'text': '未找到资源文件请放置一枚arcaea的apk到机器人的assets目录并重命名为arc.apk后使用~b30 initialize初始化资源。'}
else:
resp = await getb30(friendcode)
else:
resp = {'text': '请输入好友码!'}
msgchain = [Plain(resp['text'])]
2021-07-28 18:51:24 +00:00
if 'file' in resp and msg.Feature.image:
2021-07-27 16:03:48 +00:00
msgchain.append(Image(path=resp['file']))
2021-08-07 07:56:48 +00:00
await msg.sendMessage(msgchain)