diff options
author | Kyomotoi <[email protected]> | 2021-03-14 16:22:34 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2021-03-14 16:22:34 +0800 |
commit | 64a991e035e52e0a17e73d4e671a22ea9a7489da (patch) | |
tree | 8952d23a3d0f165d363e134ff7c64dbf05a670d3 /ATRI/plugins/github.py | |
parent | da888ff020805a38a17e5f83705aeb42ffa992ba (diff) | |
download | ATRI-64a991e035e52e0a17e73d4e671a22ea9a7489da.tar.gz ATRI-64a991e035e52e0a17e73d4e671a22ea9a7489da.tar.bz2 ATRI-64a991e035e52e0a17e73d4e671a22ea9a7489da.zip |
✨🐛 更新插件,修复一些bug
Diffstat (limited to 'ATRI/plugins/github.py')
-rw-r--r-- | ATRI/plugins/github.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/ATRI/plugins/github.py b/ATRI/plugins/github.py index 118d6f5..167ca2f 100644 --- a/ATRI/plugins/github.py +++ b/ATRI/plugins/github.py @@ -1,26 +1,9 @@ -#!/usr/bin/env python3 -# -*- coding:utf-8 -*- -''' -File: github.py -Created Date: 2021-02-26 23:22:34 -Author: Kyomotoi -Email: [email protected] -License: GPLv3 -Project: https://github.com/Kyomotoi/ATRI --------- -Last Modified: Sunday, 7th March 2021 3:11:56 pm -Modified By: Kyomotoi ([email protected]) --------- -Copyright (c) 2021 Kyomotoi -''' - import re import json - -from nonebot.plugin import on_message from nonebot.adapters.cqhttp import Bot, MessageEvent -from ATRI.rule import is_in_banlist, is_in_dormant +from ATRI.service import Service as sv +from ATRI.rule import is_block, is_in_dormant from ATRI.utils.request import get_bytes from ATRI.exceptions import RequestTimeOut @@ -28,7 +11,8 @@ from ATRI.exceptions import RequestTimeOut URL = "https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}" -github_issues = on_message(rule=is_in_banlist() & is_in_dormant()) +github_issues = sv.on_message(rule=is_block() & is_in_dormant()) +sv.manual_reg_service("GitHubIssue速览") @github_issues.handle() async def _github_issues(bot: Bot, event: MessageEvent) -> None: |