from core.builtins import Bot
from core.component import module
from modules.github import repo, user, search
github = module('github', alias='gh', developers=['Dianliang233'], desc='{github.help.desc}')
@github.handle('<name> {{github.help}}')
async def _(msg: Bot.MessageSession, name: str):
if '/' in name:
await repo.repo(msg)
else:
await user.user(msg)
@github.handle('repo <name> {{github.help.repo}}')
async def _(msg: Bot.MessageSession):
@github.handle(('user <name> {{github.help.user}}'))
@github.handle('search <query> {{github.help.search}}')
await search.search(msg)