summaryrefslogtreecommitdiff
path: root/ATRI/plugins/rich
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-04-11 15:03:35 +0800
committerKyomotoi <[email protected]>2021-04-11 15:03:35 +0800
commitcbf4900c5c3b1de65e55ce480d4b453091528e84 (patch)
tree6bde5ad2d8f6f4010cb317b2b72be36f17b503d4 /ATRI/plugins/rich
parent212424da74fecbd77c9824e422ea8b028b330c9e (diff)
downloadATRI-cbf4900c5c3b1de65e55ce480d4b453091528e84.tar.gz
ATRI-cbf4900c5c3b1de65e55ce480d4b453091528e84.tar.bz2
ATRI-cbf4900c5c3b1de65e55ce480d4b453091528e84.zip
πŸš€βœ¨βš‘οΈπŸŽ¨πŸ› ζ­£εΌζŽ¨ι€
Diffstat (limited to 'ATRI/plugins/rich')
-rw-r--r--ATRI/plugins/rich/__init__.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/ATRI/plugins/rich/__init__.py b/ATRI/plugins/rich/__init__.py
index 8404da6..9d5d6a9 100644
--- a/ATRI/plugins/rich/__init__.py
+++ b/ATRI/plugins/rich/__init__.py
@@ -6,10 +6,6 @@ from nonebot.adapters.cqhttp import Bot, MessageEvent
from ATRI.service import Service as sv
from ATRI.utils.request import get_bytes
from ATRI.utils.list import count_list, del_list_aim
-from ATRI.rule import (
- is_block,
- is_in_dormant,
-)
from .data_source import dec
@@ -17,10 +13,7 @@ from .data_source import dec
temp_list = []
-bilibili_rich = sv.on_message(
- rule=is_block() & is_in_dormant()
-)
-sv.manual_reg_service("监听b站小程序")
+bilibili_rich = sv.on_message()
@bilibili_rich.handle()
async def _bilibili_rich(bot: Bot, event: MessageEvent) -> None:
@@ -30,7 +23,10 @@ async def _bilibili_rich(bot: Bot, event: MessageEvent) -> None:
if "qqdocurl" not in msg:
if "av" in msg:
- av = re.findall(r"(av\d+)", msg)[0].replace('av', '')
+ try:
+ av = re.findall(r"(av\d+)", msg)[0].replace('av', '')
+ except:
+ return
else:
try:
bv = re.findall(r"(BV\w+)", msg)
@@ -49,7 +45,10 @@ async def _bilibili_rich(bot: Bot, event: MessageEvent) -> None:
if not bv:
if "av" in msg:
- av = re.findall(r"(av\d+)", msg)[0].replace('av', '')
+ try:
+ av = re.findall(r"(av\d+)", msg)[0].replace('av', '')
+ except:
+ return
else:
return