diff options
author | Lint Action <[email protected]> | 2021-05-04 06:09:42 +0000 |
---|---|---|
committer | Lint Action <[email protected]> | 2021-05-04 06:09:42 +0000 |
commit | 07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce (patch) | |
tree | b02c1b4e674acf6f56cf7335ad05acd0523af91c /ATRI/plugins/github.py | |
parent | 8e94b4cd4aea1943a9639b900e33fe0fa1de5bb8 (diff) | |
download | ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.tar.gz ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.tar.bz2 ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.zip |
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/plugins/github.py')
-rw-r--r-- | ATRI/plugins/github.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ATRI/plugins/github.py b/ATRI/plugins/github.py index c238b69..e7c0d80 100644 --- a/ATRI/plugins/github.py +++ b/ATRI/plugins/github.py @@ -12,6 +12,7 @@ URL = "https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}" github_issues = sv.on_message() + @github_issues.handle() async def _github_issues(bot: Bot, event: MessageEvent) -> None: msg = str(event.message) @@ -19,21 +20,19 @@ async def _github_issues(bot: Bot, event: MessageEvent) -> None: need_info = re.findall(patt, msg) if not need_info: return - + for i in need_info: need_info = list(i) owner = need_info[0] repo = need_info[1] issue_number = need_info[2] - url = URL.format(owner=owner, - repo=repo, - issue_number=issue_number) - + url = URL.format(owner=owner, repo=repo, issue_number=issue_number) + try: data = await get_bytes(url) except RequestTimeOut: return - + data = json.loads(data) msg0 = ( f"{repo}: #{issue_number} {data['state']}\n" |