Giter Site home page Giter Site logo

nonebot-plugin-bing-chat's Introduction

Typing SVG


  • I aim to acquire diverse new knowledge through practical experience.

  • I aspire to engage in friendly interactions with everyone and form interesting friendships.


github-readme-stats


📊 This Week I Spent My Time On

🕑︎ Time Zone: America/Los_Angeles

💬 Programming Languages: 
Rust                     10 hrs 2 mins       ███████████████░░░░░░░░░░   59.52 % 
TypeScript               5 hrs 30 mins       ████████░░░░░░░░░░░░░░░░░   32.64 % 
Java                     21 mins             █░░░░░░░░░░░░░░░░░░░░░░░░   02.14 % 
TOML                     18 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.86 % 
R                        11 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.14 % 

🔥 Editors: 
VS Code                  16 hrs 51 mins      █████████████████████████   100.00 % 

🐱‍💻 Projects: 
slime-chunk-finder       8 hrs 8 mins        ████████████░░░░░░░░░░░░░   48.31 % 
hw-quilt                 5 hrs 44 mins       █████████░░░░░░░░░░░░░░░░   34.02 % 
slime_chunk_finder       2 hrs 4 mins        ███░░░░░░░░░░░░░░░░░░░░░░   12.32 % 
find-slime-chunk-master  15 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.50 % 
STAT-311                 11 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.14 % 

💻 Operating System: 
Mac                      8 hrs 32 mins       █████████████░░░░░░░░░░░░   50.66 % 
Windows                  8 hrs 19 mins       ████████████░░░░░░░░░░░░░   49.34 % 

Last Updated on 16/07/2024 04:15:30 UTC

nonebot-plugin-bing-chat's People

Contributors

17theword avatar dependabot[bot] avatar harry-jing avatar lgc2333 avatar nekoaria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nonebot-plugin-bing-chat's Issues

一处小小的错误

nonebot_plugin_bing_chat/common/utils.py
第51行,历史记录应为plugin_config.bingchat_command_history_chat
image

[🐛 Bug] v0.5.4消息匹配成功后没有阻断消息传输

我看到command_chat和command_new_chat和command_history_chat和message_all都设置了block=False
我认为阻断message_all大体是非常合理的,不然会出现上个别人的issue的问题

但是这个阻断(特别是前三个阻断)给我导致了一些问题:
我使用了别的聊天插件实现聊天功能,bingchat只是其中一个功能,因为另一个聊天私聊情况下插件会处理使用未被阻断的消息,所以导致了冲突

所以我的建议是:
1、command_chat和command_new_chat和command_history_chat开启阻断,或者搞一个开关控制
2、message_all设置为不阻断,但是如果消息匹配为需要处理就进行阻断
2、添加优先性可自定义配置,方便处理和其他插件的触发逻辑

关于请求并发的问题。

进过测试,您制作的new bing chat bot好像是单线程请求的,而且同一个人在不同群进行请求时还会发生错乱。

[🚀 Feature] 支持QQ频道?(gocq频道补丁)

经测试插件不能在频道使用。
可以响应默认chat命令,但回复为:[CQ:reply,id=BAAkQ84aBbJeAAAAAABW+AYAAAAAAAANaA==]正在请求 且消息不是回复消息,只是一条普通的消息。
然后找不到消息并报错
报错内容

nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(data=None, echo='2', message='消息不存在', msg='MESSAGE_NOT_FOUND', retcode=100, status='failed', wording='消息不存在')

插件很好用,但有部分场景应用于QQ频道。希望作者能在空闲时间增加对QQ频道的支持(gocq频道补丁)。感谢如此优秀的插件。

[🐛 Bug] requests.exceptions.TooManyRedirects: Exceeded 30 redirects

cookies文件应该是没有问题的(复制了三次),在本地粘贴后上传到服务器。
运行环境:python3.10,Ubuntu22.04
日志文件如下

03-06 22:12:32 [DEBUG] nonebot | Checking for matchers in priority 1...
03-06 22:12:32 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils)
03-06 22:12:32 [DEBUG] nonebot | Running Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils)
03-06 22:12:32 [DEBUG] nonebot | Running handler Dependent(call=bing_chat_command_chat)
03-06 22:12:37 [DEBUG] nonebot | OneBot V11 | Calling API send_msg
03-06 22:12:37 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils) running complete
03-06 22:12:37 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils) failed.
Traceback (most recent call last):
File "", line 15, in
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/init.py", line 273, in run
get_driver().run(*args, **kwargs)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 172, in run
uvicorn.run(
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
server.run()
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/message.py", line 188, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run
await handler(
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot_plugin_bing_chat/onebotv11/main.py", line 59, in bing_chat_command_chat
raise exc
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/nonebot_plugin_bing_chat/onebotv11/main.py", line 54, in bing_chat_command_chat
current_user_data.chatbot = Chatbot(
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/EdgeGPT.py", line 269, in init
self.chat_hub: ChatHub = ChatHub(Conversation(self.cookiePath, self.cookies))
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/EdgeGPT.py", line 178, in init
response = self.session.get(
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/requests/sessions.py", line 723, in send
history = [resp for resp in gen]
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/requests/sessions.py", line 723, in
history = [resp for resp in gen]
File "/root/SLEXCE/QQlinux/enjoy/.venv/lib/python3.10/site-packages/requests/sessions.py", line 191, in resolve_redirects
raise TooManyRedirects(
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
03-06 22:12:37 [DEBUG] nonebot | Stop event propagation

突然出现异常,无法进行回复

可以在new_bing里面对话但是通过qq不行
03-20 15:02:23 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils) failed.
Traceback (most recent call last):
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\EdgeGPT.py", line 212, in init
raise NotAllowedToAccess(self.struct["result"]["message"])
EdgeGPT.NotAllowedToAccess: Sorry, you need to login first to access this service.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 17, in
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
uvicorn.run(
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\base_events.py", line 637, in run_until_complete
self.run_forever()
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\base_events.py", line 604, in run_forever
self._run_once()
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\base_events.py", line 1909, in _run_once
handle._run()
File "D:\Anaconda\envs\py3-11-0\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run
await handler(
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 91, in bingchat_command_chat
raise exc
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 86, in bingchat_command_chat
current_user_data.chatbot = Chatbot(
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\EdgeGPT.py", line 290, in init
self.chat_hub: ChatHub = ChatHub(Conversation(self.cookiePath, self.cookies))
File "D:\Anaconda\envs\py3-11-0\Lib\site-packages\EdgeGPT.py", line 214, in init
raise Exception(
Exception: Authentication failed. You have not been accepted into the beta.

[🐛 Bug] v0.5.1所有指令都会被 nonebot-plugin-bing-chat 阻断,导致其他插件指令无法触发

03-11 10:51:59 [SUCCESS] nonebot | OneBot V11 | [message.group.normal]: Message from @[群:] "有点熟悉这个金毛"
03-11 10:51:59 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils)
03-11 10:51:59 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils) running complete
03-11 10:52:00 [SUCCESS] nonebot | OneBot V11 | [message.group.normal]: Message - from @[群:] "今日欲望"
03-11 10:52:00 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils)
03-11 10:52:00 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils) running complete

你好 有个问题想询问一下

这个newbing插件是需要获得newbing的测试资格才可以使用这个newbing插件吗 抱歉这个问题有点无脑的样子 因为我在引用后返回给我的错误信息是
<无法创建Chatbot>
Authentication failed. You have not been accepted into the beta.
我不太确定是我的操作流程有问题还是因为我没有获得newbing的测试资格

KeyError: 'messages'

日志报错:
File "/home/zhenxun_bot/bot.py", line 22, in
nonebot.run()
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/init.py", line 273, in run
get_driver().run(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 172, in run
uvicorn.run(
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
server.run()
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/root/.pyenv/versions/3.10.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 188, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run
await handler(
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.10/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/onebotv11/main.py", line 91, in bing_chat_command_chat
raise exc
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/onebotv11/main.py", line 82, in bing_chat_command_chat
response = await chatbot.ask(
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/common/bing.py", line 279, in ask
async for final, response in self.chat_hub.ask_stream(
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/common/bing.py", line 242, in ask_stream
yield False, response["arguments"][0]["messages"][0][
KeyError: 'messages'

系统:Ubuntu20.04
Python版本:3.10.10
问题描述:
是否需要梯子才能获取信息?还有那个cookies.json这个是新建在bot的data文件夹里面的是吗?

pip找不到包

ERROR: Could not find a version that satisfies the requirement nonebot-plugin-bing-chat (from versions: none)
ERROR: No matching distribution found for nonebot-plugin-bing-chat

无法多次对话

发起新对话的第一次请求时,正常回复。

后续对话会回复如下:
<无法询问,如果出现多次请试刷新>
Cannot write to closing transport

一点问题

请问之后使用这个插件是不是一定需要挂梯子啊,没有挂好像就会报这个错
image

能否增加自动刷新对话的功能

目前只能连续对话五次?
超过了还得艾特机器人刷新对话。挺麻烦的。
能否加个新功能。在超过了这个上限后自动进行刷新操作重新开始新的对话。

超过上限后AI会回复如下内容。
【Thanks for this conversation! I've reached my limit, will you hit “New topic,” please?】
【That's the most I can say about that. Click “New topic” and we can keep chatting!】
【Sorry, I think we need to move on! Click “New topic” to chat about something else.】

提两个案:
1.也许能根据是否含有【“New topic”】来判断是否超过上限
2.通过count对话次数自行判断。如果这个次数能配置的话以后bing更新了上限也能继续留用

🙏

提问部分内容调用content_simple时出错

提问 chat サガプラネッツ的全部作品有哪些?
qq返回 <调用content_simple时出错>
<无效的响应值, 请管理员查看控制台>

03-05 01:57:57 [INFO] nonebot_plugin_gocqhttp | [2858352056] 发送群 test(706053038) 的消息: [{"type": ... (-1299447791)03-05 01:58:17 [ERROR] nonebot_plugin_bing_chat | {'type': 2, 'invocationId': '0', 'item': {'messages': [{'text': 'サガ プラネッツ的全部作品有哪些?', 'topicChangerText': 'Suggest a topic.', 'author': 'user', 'from': {'id': '844428454516157', 'name': None}, 'createdAt': '2023-03-04T17:57:57.9526446+00:00', 'timestamp': '2023-03-04T17:57:57.950243+00:00', 'locale': 'en-us', 'market': 'en-us', 'region': 'us', 'messageId': 'e71baac4-bb5b-4bf6-98ba-8d9eb58b1810', 'requestId': 'e71baac4-bb5b-4bf6-98ba-8d9eb58b1810', 'offense': 'OffenseTrigger', 'feedback': {'tag': None, 'updatedOn': None, 'type': 'None'}, 'contentOrigin': 'cib', 'privacy': None, 'inputMethod': 'Keyboard'}, {'hiddenText': "Sorry, I don't have enough knowledge to talk about this. By the way, were you aware pteronophobia is the fear of being tickled by feathers", 'topicChangerText': 'By the way, were you aware pteronophobia is the fear of being tickled by feathers', 'author': 'bot', 'createdAt': '2023-03-04T17:58:05.1121673+00:00', 'timestamp': '2023-03-04T17:58:05.1121673+00:00', 'messageId': '95f63bed-880f-437c-9471-524b379e6145', 'requestId': 'e71baac4-bb5b-4bf6-98ba-8d9eb58b1810', 'offense': 'None', 'adaptiveCards': [{'type': 'AdaptiveCard', 'body': [{'type': 'TextBlock', 'text': "Sorry, I don't have enough knowledge to talk about this. You can learn more on bing.com. ", 'wrap': True}, {'type': 'TextBlock', 'text': 'By the way, were you aware pteronophobia is the fear of being tickled by feathers', 'wrap': True}]}], 'sourceAttributions': [{'providerDisplayName': 'SAGA PLANETS - 維基百科,自由的百科全書', 'seeMoreUrl': 'https://zh.wikipedia.org/zh-tw/SAGA_PLANETS', 'searchQuery': 'サガプラネッツ 作品'}, {'providerDisplayName': 'SAGA PLANETSとは (サガプラネッツ とは) [単語記事] - ニコニコ大百科', 'seeMoreUrl': 'https://dic.nicovideo.jp/a/saga%20planets', 'searchQuery': 'サガプラ ネッツ 作品'}, {'providerDisplayName': 'SAGA PLANETS OFFICIAL HOMEPAGE', 'seeMoreUrl': 'http://sagapla.net/top.html', 'searchQuery': 'サガプラネッツ 作品'}, {'providerDisplayName': 'SAGA PLANETS OFFICIAL HOMEPAGE', 'seeMoreUrl': 'https://sagapla.net/', 'searchQuery': 'サガプラネッツ 作品'}], 'feedback': {'tag': None, 'updatedOn': None, 'type': 'None'}, 'contentOrigin': 'Apology', 'scores': [{'component': 'content_filter', 'score': 1}], 'privacy': None}], 'firstNewMessageIndex': 1, 'conversationId': '51D|BingProd|3F03158FBA96F0FE1CAFD0D5004EA5E02F54EF59DA8960AEC4D55AD0576037EF', 'requestId': 'e71baac4-bb5b-4bf6-98ba-8d9eb58b1810', 'conversationExpiryTime': '2023-03-04T23:58:16.9318456Z', 'shouldInitiateConversation': False, 'telemetry': {'metrics': None, 'startTime': '2023-03-04T17:57:57.9503092Z'}, 'throttling': {'maxNumUserMessagesInConversation': 6, 'numUserMessagesInConversation': 1}, 'result': {'value': 'Success', 'message': 'サガプラネッツ 作品', 'serviceVersion': '20230304.13'}}}

bing新功能

1
请问必应这个新的对话样式能实现吗?

直接回复机器人的消息会报错

我一直使用/chat命令可以正常对话,但是长按bot消息点击回复,则会报错。报错信息如下:

Traceback (most recent call last):
  File "/home/user_me/workspace/bot/Alice/bot.py", line 17, in <module>
    nonebot.run()
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 187, in run
    uvicorn.run(
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/home/user_me/miniconda3/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/bot.py", line 190, in handle_event
    await _check_reply(self, event)
> File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/bot.py", line 34, in _check_reply
    event.reply = Reply.parse_obj(await bot.get_msg(message_id=msg_seg.data["id"]))
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/internal/adapter/bot.py", line 120, in call_api
    raise exception
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/internal/adapter/bot.py", line 98, in call_api
    result = await self.adapter._call_api(self, api, **data)
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 132, in _call_api
    return handle_api_result(await self._result_store.fetch(seq, timeout))
  File "/home/user_me/workspace/bot/Alice/.venv/lib/python3.10/site-packages/nonebot/adapters/onebot/v11/utils.py", line 58, in handle_api_result
    raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(data=None, echo='17', msg='MSG_NOT_FOUND', retcode=100, status='failed', wording='消息不存在')

加载插件提示SyntaxError: invalid syntax

报错日志:
File "/home/zhenxun_bot/bot.py", line 16, in
nonebot.load_plugins("extensive_plugin")
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.9/lib/python3.9/site-packages/nonebot/plugin/load.py", line 45, in load_plugins
return manager.load_all_plugins()
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.9/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.9/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))

File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.9/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 145, in load_plugin
module = importlib.import_module(
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-UH4sDRIh-py3.9/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/init.py", line 1, in
from .common.utils import initFile
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/common/utils.py", line 13, in
from .dataModel import Config
File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_bing_chat/common/dataModel.py", line 80
match v:
^
SyntaxError: invalid syntax

系统:Ubuntu20.04
问题描述:
手动加载,提示这个。

您好~我发现有两个问题~

第一个是用脚手架安装后,找不到插件,无法加载,看了下是安装后在虚拟环境的site-packages里面没有nonebot_plugin_bing_chat文件夹,通过下载文件把里面的这个文件夹复制进来后才能正常加载插件。
第二个是测试后报错:.venv\Lib\site-packages\nonebot_plugin_bing_chat_init_.py", line 35, in bing_chat_command_chat is_valid_user, return_str = permissionsCheck(event=event)
TypeError: cannot unpack non-iterable NoneType object
我在查了下是说:
permissionsCheck函数是在这个文件中定义的:nonebot_plugin_bing_chat/utils.py。根据这个文件,permissionsCheck函数有可能返回None,如果event没有user_id或者user_id不在白名单中会遇到TypeError: cannot unpack non-iterable NoneType object的错误,因为试图从一个None值中解包两个变量。我尝试在config的白名单里添加QQ号,可是依然没有成功。

无法正常连续会话

只有第一次开始对话会正常回复,之后继续使用指令对话和回复均出现以下回复信息:

<无法询问,如果出现多次请试刷新>
Cannot write to closing transport

不过刷新后开启的是新一轮会话。

其中使用指令对话的报错信息如下:

[ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_bing_chat.common.utils) failed.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "F:\Bot\.venv\lib\site-packages\nonebot_plugin_reboot\reloader.py", line 27, in _run
    _nb_run(*args, **kwargs)
  File "F:\Bot\.venv\lib\site-packages\nonebot\__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "F:\Bot\.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run
    uvicorn.run(
  File "F:\Bot\.venv\lib\site-packages\uvicorn\main.py", line 569, in run
    server.run()
  File "F:\Bot\.venv\lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever
    self._run_once()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
    handle._run()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "F:\Bot\.venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "F:\Bot\.venv\lib\site-packages\nonebot\message.py", line 187, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "F:\Bot\.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "F:\Bot\.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run
    await handler(
  File "F:\Bot\.venv\lib\site-packages\nonebot\dependencies\__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "F:\Bot\.venv\lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 110, in bingchat_command_chat
    raise exc
  File "F:\Bot\.venv\lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 101, in bingchat_command_chat
    response = await chatbot.ask(
  File "F:\Bot\.venv\lib\site-packages\EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "F:\Bot\.venv\lib\site-packages\EdgeGPT.py", line 268, in ask_stream
    await self.wss.send_str(append_identifier(self.request.struct))
  File "F:\Bot\.venv\lib\site-packages\aiohttp\client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "F:\Bot\.venv\lib\site-packages\aiohttp\http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "F:\Bot\.venv\lib\site-packages\aiohttp\http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

使用回复对话的报错和上一个Issue相同。

不太清楚怎么解决,gocqhttp也没有更新。
话说这和new bing开放有关系么,我就是看到开放来接入bot了(x

无法连接到nebwing

05-07 14:28:10 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_bing_chat.common) failed.
Traceback (most recent call last):
File "D:\NoneBot\ABK.venv\lib\site-packages\websockets\legacy\client.py", line 663, in await_impl
_transport, _protocol = await self._create_connection()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1036, in create_connection
infos = await self._ensure_resolved(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1418, in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 863, in getaddrinfo
return await self.run_in_executor(
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 456, in wait_for
return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 17, in
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot_init_.py", line 309, in run
get_driver().run(*args, **kwargs)
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "D:\NoneBot\ABK.venv\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\NoneBot\ABK.venv\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 121, in bingchat_command_chat
raise exc
File "D:\NoneBot\ABK.venv\lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 112, in bingchat_command_chat
response = await chatbot.ask(
File "D:\NoneBot\ABK.venv\lib\site-packages\EdgeGPT.py", line 376, in ask
async for final, response in self.chat_hub.ask_stream(
File "D:\NoneBot\ABK.venv\lib\site-packages\EdgeGPT.py", line 293, in ask_stream
self.wss = await websockets.connect(
File "D:\NoneBot\ABK.venv\lib\site-packages\websockets\legacy\client.py", line 659, in await_impl_timeout
return await asyncio.wait_for(self.await_impl(), self.open_timeout)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 458, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

通过 SAA 实现更简洁的跨平台

SAA 目前支持了OneBot v11 | OneBot v12 | QQ Guild | Kaiheila 四种平台的图片、文字、at及回复消息
如果您暂时没有时间进行适配,可以提供一下目前最新进度的分支吗,我注意到目前有多个进度不一的分支,不知应对哪个进行修改

无法通过脚手架下载

image
如图,报错提示Could not find a version that satisfies the requirement nonebot-plugin-bing-chat (from versions: none),可能是版本号没配上?

[🚀 Feature] 更加自然的连续对话与群内共享对话

目前版本请求 bing 时必须输入命令,在连续对话时显得较为繁琐。

How

  • 添加配置项以支持在 @bot 聊天内容 时自动请求 Bing,设置为 True 时覆写 BING_COMMAND_CHAT
  • 添加配置项以修改上述功能的优先级,方便用户自定义来调整触发频率(例如,用户还有其它 @bot 聊天内容 的应用,想要将 BING 相应放在最后,此时可以调整优先级的配置到其它应用后,并设置其他应用的 block=1

具体实现可以参考 chatgpt 利用钩子函数在启动成功读取配置项后再添加即可。

bot<无法创建Chatbot> Authentication failed

[nonebot-plugin-bing-chat]和[EdgeGPT]已经更新到最新
image
image
提示认证失败,实际使用账号登录www.bing.com,可以在网页上直接与bing对话

bot报错提示,gocq使用的是手表协议
A0@IXP_B `~0EZ07DYE0TRM

昨天还能正常使用,期间未对bot进行任何修改,今天突然报错不知道是什么原因引起的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.