Compare commits

..

3 Commits

Author SHA1 Message Date
d77324b714 fix: 增加热刺和纽卡的预测 2023-10-07 14:18:43 +08:00
829ce230a1 fix: 修改忽略 2023-09-28 17:41:12 +08:00
b1a69bdd94 fix: 增加异常捕捉 2023-09-28 17:37:38 +08:00
4 changed files with 18 additions and 8 deletions

2
.gitignore vendored
View File

@@ -140,3 +140,5 @@ dmypy.json
# End of https://www.toptal.com/developers/gitignore/api/python
.idea
cqhttp/data
cqhttp/device.json
cqhttp/session.token

Binary file not shown.

View File

@@ -30,7 +30,7 @@ async def handle_first_receive(bot: Bot, event: Event, state: T_State, args= Com
for item in saishiContent:
if item.html.find("英超") >= 0:
if item.html.find("阿森纳") >= 0 or item.html.find("曼城") >= 0 or item.html.find("曼联") >= 0 or item.html.find(
"利物浦") >= 0 or item.html.find("切尔西") >= 0:
"利物浦") >= 0 or item.html.find("切尔西") >= 0 or item.html.find("热刺") >= 0 or item.html.find("纽卡") >= 0:
rouneNum, vsStr = parserSaishiItem(item.html)
if rouneNum not in vsMap.keys():
vsMap[rouneNum] = []

View File

@@ -9,7 +9,8 @@ from nonebot import on_command
from nonebot.rule import to_me
from requests_html import HTMLSession, HTML
import json
from selenium.webdriver import Chrome, ChromeOptions
from nonebot import logger
# from selenium.webdriver import Chrome, ChromeOptions
tongjiCommand = on_command("统计", rule=to_me(), aliases={'微头条', 'tongji', 'tj'}, priority=10)
@@ -23,12 +24,19 @@ weitoutiaoMap = {"太能喵": 0, "小小": 0, "大帝强": 0, "叶小欢": 0}
"""
@tongjiCommand.handle()
async def handle_first_receive(bot: Bot, event: Event, state: T_State, args= CommandArg()):
# 清空原有的weitoutiaoMap中的统计结果
for k,v in weitoutiaoMap.items():
weitoutiaoMap[k] = 0
getWeiToutiaoInfo()
# 将上周的微头条考核结果发送给用户
await tongjiCommand.finish(str(weitoutiaoMap))
from nonebot.exception import MatcherException
try:
# 清空原有的weitoutiaoMap中的统计结果
for k,v in weitoutiaoMap.items():
weitoutiaoMap[k] = 0
getWeiToutiaoInfo()
# 将上周的微头条考核结果发送给用户
await tongjiCommand.finish(str(weitoutiaoMap))
except MatcherException:
raise
except Exception as e:
logger.error(e)
print(e)
"""
获取微头条数据信息