summaryrefslogtreecommitdiff
path: root/ATRI/plugins/plugin_chat/__init__.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2020-11-07 14:49:51 +0800
committerKyomotoi <[email protected]>2020-11-07 14:49:51 +0800
commitc9074b24b98efe18096256ab680535f50691f67d (patch)
treefb912e4506e478d3d61e89b2824fc83d69eae7cd /ATRI/plugins/plugin_chat/__init__.py
parent85517a82b9f787ed7c3008655c8dc04d8e6f0a30 (diff)
downloadATRI-c9074b24b98efe18096256ab680535f50691f67d.tar.gz
ATRI-c9074b24b98efe18096256ab680535f50691f67d.tar.bz2
ATRI-c9074b24b98efe18096256ab680535f50691f67d.zip
[Upload]
Diffstat (limited to 'ATRI/plugins/plugin_chat/__init__.py')
-rw-r--r--ATRI/plugins/plugin_chat/__init__.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/ATRI/plugins/plugin_chat/__init__.py b/ATRI/plugins/plugin_chat/__init__.py
index 0a718b0..9d70f7a 100644
--- a/ATRI/plugins/plugin_chat/__init__.py
+++ b/ATRI/plugins/plugin_chat/__init__.py
@@ -2,7 +2,7 @@
# -*- encoding: utf-8 -*-
'''
@File : __init__.py
-@Time : 2020/10/11 14:38:38
+@Time : 2020/11/07 14:24:57
@Author : Kyomotoi
@Contact : [email protected]
@Github : https://github.com/Kyomotoi
@@ -13,6 +13,7 @@ __author__ = 'kyomotoi'
import json
from pathlib import Path
from random import choice
+from requests import exceptions
from nonebot.log import logger
from nonebot.rule import to_me
@@ -104,7 +105,7 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
await groupEvent.finish(
f'好欸!事新人[CQ:at,qq={event.raw_event["user_id"]}]' # type: ignore
) # type: ignore
- await groupEvent.finish(f"在下 ATRI,你可以叫我 亚托莉 或 アトリ !~w")
+ await groupEvent.finish("在下 ATRI,你可以叫我 亚托莉 或 アトリ !~w")
elif event.raw_event[ # type: ignore
"notice_type"] == "group_decrease":
@@ -113,16 +114,16 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
)
-# 舆情监听系统
-listenPublicOpinion = on_message()
-file_PO = Path(
- '.') / 'ATRI' / 'plugins' / 'plugin_chat' / 'public_opinion.json'
+# # 舆情监听系统
+# listenPublicOpinion = on_message()
+# file_PO = Path(
+# '.') / 'ATRI' / 'plugins' / 'plugin_chat' / 'public_opinion.json'
[email protected]() # type: ignore
-async def _(bot: Bot, event: Event, state: dict) -> None:
- with open(file_PO, 'r') as f:
- data = json.load(f)
+# @groupEvent.handle() # type: ignore
+# async def _(bot: Bot, event: Event, state: dict) -> None:
+# with open(file_PO, 'r') as f:
+# data = json.load(f)
# 口臭一下
@@ -151,7 +152,7 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
try:
msg = request_api_text(URL)
- except:
+ except exceptions:
await fxxkMe.finish(errorRepo("请求错误"))
await fxxkMe.finish(msg)