summaryrefslogtreecommitdiff
path: root/ATRI/plugins/github.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-05-04 06:29:07 +0000
committerLint Action <[email protected]>2021-05-04 06:29:07 +0000
commit8804f1e10d507ba293fafc77a7e93d3a84a5814b (patch)
treee107da61f76dfe64dfb96feb5e961bbc4bbd8d52 /ATRI/plugins/github.py
parentea7f48011c34fdaec7e91af7eb373c8174e439e6 (diff)
downloadATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.gz
ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.bz2
ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.zip
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/plugins/github.py')
-rw-r--r--ATRI/plugins/github.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ATRI/plugins/github.py b/ATRI/plugins/github.py
index 27c5328..c8c8f2b 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 RequestError:
return
-
+
data = json.loads(data)
msg0 = (
f"{repo}: #{issue_number} {data['state']}\n"