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/github/__init__.py

29 lines
833 B
Python
Raw Normal View History

2022-06-28 06:11:03 +00:00
from core.builtins.message import MessageSession
2022-07-31 08:27:58 +00:00
from core.component import on_command
2021-07-30 08:06:10 +00:00
from modules.github import repo, user, search
2021-10-24 10:55:45 +00:00
github = on_command('github', alias=['gh'], developers=['Dianliang233'])
2021-08-07 07:56:48 +00:00
2021-10-24 10:55:45 +00:00
2021-12-18 05:42:34 +00:00
@github.handle('<name> {尝试自动识别并区分 repo/user}')
async def _(msg: MessageSession):
if '/' in msg.parsed_msg['<name>']:
await repo.repo(msg)
else:
await user.user(msg)
2022-01-20 12:13:03 +00:00
2021-10-24 10:55:45 +00:00
@github.handle('repo <name> {获取 GitHub 仓库信息}')
async def _(msg: MessageSession):
await repo.repo(msg)
@github.handle(['user <name> {获取 GitHub 用户或组织信息}', 'org <name> {~github user 的别名}'])
async def _(msg: MessageSession):
await user.user(msg)
@github.handle('search <query> {搜索 GitHub 上的仓库}')
async def _(msg: MessageSession):
await search.search(msg)