Skip to content

Commit

Permalink
修复24.12.11可用性问题;更改黑名单列表100条为一张图,分多张发送
Browse files Browse the repository at this point in the history
  • Loading branch information
nek0us committed Dec 11, 2024
1 parent a511b07 commit 56875b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions nonebot_plugin_gpt/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,15 @@ async def black_list(event: MessageEvent|QQMessageEvent,arg :Message|QQMessage):
msgs = []
if arg.extract_plain_text():
if arg.extract_plain_text() in ban_tmp:
f_tmp = ban_tmp[arg.extract_plain_text()][0].replace('"',r'\"')
f_tmp = ban_tmp[arg.extract_plain_text()][0].replace('"',r'\"').replace("\n"," ")
msgs.append(f"|{arg.extract_plain_text()}|{f_tmp}|")
else:
for x in ban_tmp:
f_tmp = ban_tmp[x][0].replace('"',r'\"')
f_tmp = ban_tmp[x][0].replace('"',r'\"').replace("\n"," ")
msgs.append(f"|{x}|{f_tmp}|")
imgs = []
if len(msgs) > 50:
chunks = list(chunked(msgs,50))
if len(msgs) > 100:
chunks = list(chunked(msgs,100))
for chunk in chunks:
tmp = msgs_head.copy()
tmp.extend(chunk)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_gpt/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from nonebot.matcher import Matcher,current_matcher
from nonebot.log import logger
from datetime import datetime
from typing import List, Literal,Dict
from typing import List, Literal,Dict,Tuple
import json

from .source import banpath,ban_str_path,whitepath,plusstatus
Expand All @@ -25,7 +25,7 @@ async def get_id_from_guild_group(event: QQMessageEvent):
return id,value

# 返回类型
async def get_id_from_all(event: MessageEvent|QQMessageEvent):
async def get_id_from_all(event: MessageEvent|QQMessageEvent) -> Tuple:
'''return id,value'''
if isinstance(event,GroupMessageEvent):
id = str(event.group_id)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "nonebot-plugin-gpt"
version = "0.0.40"
version = "0.0.41"
description = "Nonebot2's plugin of ChatGPT "
authors = [
{name = "nek0us", email = "nekouss@mail.com"},
]
license = {text = "GPL3"}
dependencies = ["ChatGPTWeb>=0.2.43","nonebot_adapter_onebot>=2.3.1","nonebot-plugin-sendmsg-by-bots>=0.1.6","nonebot_adapter_qq>=1.3.5","nonebot2>=2.0.0","more_itertools","nonebot_plugin_htmlrender","nonebot_plugin_localstore"]
dependencies = ["ChatGPTWeb>=0.2.44","nonebot_adapter_onebot>=2.3.1","nonebot-plugin-sendmsg-by-bots>=0.1.6","nonebot_adapter_qq>=1.3.5","nonebot2>=2.0.0","more_itertools","nonebot_plugin_htmlrender","nonebot_plugin_localstore"]
requires-python = ">=3.10"
readme = "README.md"

Expand Down

0 comments on commit 56875b3

Please sign in to comment.