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
822 B
Python
Raw Normal View History

2023-02-05 14:33:33 +00:00
from core.builtins import Bot
2023-03-04 08:51:56 +00:00
from core.component import module
2021-07-30 08:06:10 +00:00
from modules.github import repo, user, search
2023-03-04 08:51:56 +00:00
github = module('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}')
2023-02-05 14:33:33 +00:00
async def _(msg: Bot.MessageSession):
2021-12-18 05:42:34 +00:00
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 仓库信息}')
2023-02-05 14:33:33 +00:00
async def _(msg: Bot.MessageSession):
2021-10-24 10:55:45 +00:00
await repo.repo(msg)
@github.handle(['user <name> {获取 GitHub 用户或组织信息}', 'org <name> {~github user 的别名}'])
2023-02-05 14:33:33 +00:00
async def _(msg: Bot.MessageSession):
2021-10-24 10:55:45 +00:00
await user.user(msg)
@github.handle('search <query> {搜索 GitHub 上的仓库}')
2023-02-05 14:33:33 +00:00
async def _(msg: Bot.MessageSession):
2021-10-24 10:55:45 +00:00
await search.search(msg)