Skip to content

Commit

Permalink
🐛 移除过时依赖导入
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulinyv committed Nov 22, 2023
1 parent ed57a35 commit c67fadf
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 40 deletions.
36 changes: 18 additions & 18 deletions LittlePaimon/plugins/Paimon_Chat/utils/auth_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import defaultdict
from time import time

from littlepaimon_utils import aiorequests
# from littlepaimon_utils import aiorequests
from nonebot import logger

from .db_util import get_cookie_cache, update_cookie_cache, delete_cookie_cache
Expand Down Expand Up @@ -190,23 +190,23 @@ def get_sign_headers(cookie):
return headers


# 检查cookie是否有效,通过查看个人主页来判断
async def check_cookie(cookie):
url = 'https://bbs-api.mihoyo.com/user/wapi/getUserFullInfo?gids=2'
headers = {
'DS': get_ds(),
'Origin': 'https://webstatic.mihoyo.com',
'Cookie': cookie,
'x-rpc-app_version': "2.11.1",
'x-rpc-client_type': '5',
'Referer': 'https://webstatic.mihoyo.com/'
}
res = await aiorequests.get(url=url, headers=headers)
res = res.json()
if res['retcode'] != 0:
return False
else:
return True
# # 检查cookie是否有效,通过查看个人主页来判断
# async def check_cookie(cookie):
# url = 'https://bbs-api.mihoyo.com/user/wapi/getUserFullInfo?gids=2'
# headers = {
# 'DS': get_ds(),
# 'Origin': 'https://webstatic.mihoyo.com',
# 'Cookie': cookie,
# 'x-rpc-app_version': "2.11.1",
# 'x-rpc-client_type': '5',
# 'Referer': 'https://webstatic.mihoyo.com/'
# }
# res = await aiorequests.get(url=url, headers=headers)
# res = res.json()
# if res['retcode'] != 0:
# return False
# else:
# return True



Expand Down
1 change: 0 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
nonebot.load_builtin_plugins("echo")
nonebot.load_plugin("nonebot_plugin_apscheduler")
nonebot.load_plugin("nonebot_plugin_htmlrender")
nonebot.load_plugin("nonebot_plugin_imageutils")
nonebot.load_plugin("nonebot_plugin_txt2img")
nonebot.load_from_toml("pyproject.toml")
nonebot.load_plugin("LittlePaimon")
Expand Down
4 changes: 2 additions & 2 deletions matcher_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def _check_nickname(bot: Bot, event: MessageEvent) -> None:
nickname = m[1]
log("DEBUG", f"User is calling me {nickname}")
event.to_me = True
first_msg_seg.data["text"] = first_text[m.end():]
# first_msg_seg.data["text"] = first_text[m.end():]


nonebot.on_command = on_command_
nonebot.on_regex = on_regex_
nonebot.on_startswith = on_startswith_
nonebot.on_endswith = on_endswith_
nonebot.on_keyword = on_keyword_
v11.bot._check_nickname = _check_nickname
# v11.bot._check_nickname = _check_nickname
53 changes: 35 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ ujson = "5.5.0"
urllib3 = "1.26.12"
win32-setctime = "1.1.0"
wordcloud = "1.8.2.2"
ping3 = "^4.0.4"

[tool.nonebot]
plugins = ["nonebot_plugin_gocqhttp", "nonebot_plugin_guild_patch"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx
from nonebot import logger
from nonebot_plugin_imageutils import text2image
from pil_utils import text2image

from ..core.database.plugin_sqlite import MAACopilotSubsModel
from ..exceptions import MAAFailedResponseException, MAANoResultException
Expand Down

0 comments on commit c67fadf

Please sign in to comment.