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
746 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-12-17 04:45:16 +00:00
github = module('github', alias='gh', developers=['Dianliang233'], desc='{github.help.desc}')
2021-08-07 07:56:48 +00:00
2021-10-24 10:55:45 +00:00
2023-12-18 12:15:53 +00:00
@github.command('<name> {{github.help}}')
2023-06-04 13:03:24 +00:00
async def _(msg: Bot.MessageSession, name: str):
if '/' in name:
2021-12-18 05:42:34 +00:00
await repo.repo(msg)
else:
await user.user(msg)
2022-01-20 12:13:03 +00:00
2023-12-18 12:15:53 +00:00
@github.command('repo <name> {{github.help.repo}}')
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)
2023-12-18 12:15:53 +00:00
@github.command('user <name> {{github.help.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)
2023-12-18 12:15:53 +00:00
@github.command('search <query> {{github.help.search}}')
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)