lumoxu / spit_chatbot Goto Github PK
View Code? Open in Web Editor NEWb站视频BV1gm4y1C7oY中,Spit使用的源代码。
License: MIT License
b站视频BV1gm4y1C7oY中,Spit使用的源代码。
License: MIT License
目前还是Claude方便点,好想试试
请问端口查询该如何进行查找,我运用了作者提供的办法和网络上的办法,只找到了VPN的ip,而无法查找到VPN端口,这令我十分困惑。希望能得到作者的解答。
运行日志如下
`当前进程pid: 2268
#################################################################
██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ████████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██╔═══██╗██╔══██╗██╔═══██╗╚══██╔══╝
██████╔╝ ╚████╔╝ ██║ ██║ ██║██████╔╝██║ ██║ ██║
██╔═══╝ ╚██╔╝ ██║ ██║▄▄ ██║██╔══██╗██║ ██║ ██║
██║ ██║ ╚██████╗╚██████╔╝██████╔╝╚██████╔╝ ██║
╚═╝ ╚═╝ ╚═════╝ ╚══▀▀═╝ ╚═════╝ ╚═════╝ ╚═╝
v0.5.1.1 BY FengLiu
#################################################################
[2023-07-12 18:52:56,531][go-cqhttp/WARNING] PyCqBot: go-cqhttp 警告 Protocol -> device lock is disable. http api may fail.
[2023-07-12 18:53:12,036][MainThread/INFO] PyCqBot: 正在连接 go-cqhttp websocket 服务
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 139, in read_http_response
status_code, reason, headers = await read_response(self.reader)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\http.py", line 130, in read_response
raise ValueError(f"unsupported HTTP version: {d(version)}")
ValueError: unsupported HTTP version: HTTP/1.0
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Spit_chatBot\qqbot.py", line 447, in
bot.start()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\pycqBot\cqHttpApi.py", line 361, in start
self._websocket_start()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\pycqBot\cqHttpApi.py", line 401, in _websocket_start
asyncio.run(main_logic())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\pycqBot\cqHttpApi.py", line 375, in main_logic
async with websockets.connect(self.__host) as websocket:
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 637, in aenter
return await self
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 655, in await_impl_timeout
return await self.await_impl()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 662, in await_impl
await protocol.handshake(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 323, in handshake
status_code, response_headers = await self.read_http_response()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 145, in read_http_response
raise InvalidMessage("did not receive a valid HTTP response") from exc
websockets.exceptions.InvalidMessage: did not receive a valid HTTP response
PS D:\Spit_chatBot> Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.
Failed to write to log, write /dev/stdout: The pipe is being closed.`
在于 ChatGPT 中若进行本地的 Request 不论任何平台例如 NodeJs & Python
出现了返回 unexpected EOF 字样, 则可能出现了如下情况:
tips:(对于要将 Spit_chatBot 库转换成 NodeJs 平台上的开发者)
在于 NodeJs 平台中获取 ChatGPT 的 Response 时, 出现了 Circle Parse 等字样.
不用担心, 那是 OpenAI 的原生库造成的, 它使用了 Axios 库进行请求, 但是在处理 TCP Connect 出现了循环 Object.
即无限套娃, 但是在通常中 Js 解释器不会发现, 除非调用了 JSON.stringify.
你可以尝试 try catch 块捕捉该错误, 并让 bot 干其他事 (发送表情或者什么都不用做)
Ready to answer...
bot回复: 你好啊,怎么一直在重复发相同的消息? (Tokens used: 402)
处理后回复: ['你好啊', '怎么一直在重复发相同的消息()']
[2023-05-30 23:07:16,048][cqhttp_shell/WARNING] PyCqBot: go-cqhttp ]
[2023-05-30 23:07:16,049][asyncHttp_loop/ERROR] PyCqBot: api 发生错误 SEND_MSG_API_ERROR: send group message failed: blocked by server code: 100
[2023-05-30 23:07:27,329][cqhttp_shell/WARNING] PyCqBot: go-cqhttp ]
[2023-05-30 23:07:27,330][asyncHttp_loop/ERROR] PyCqBot: api 发生错误 SEND_MSG_API_ERROR: send group message failed: blocked by server code: 100
e:\BOTS\pycqBot\qqbot.py:85: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
counter.loc[group_id]['api_used'] += api_used
e:\BOTS\pycqBot\qqbot.py:86: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
counter.loc[group_id]['msgs_sent'] += num_of_msgs
Replied sticker: 19
[2023-05-30 23:07:32,697][cqhttp_shell/WARNING] PyCqBot: go-cqhttp ]
[2023-05-30 23:07:32,698][asyncHttp_loop/ERROR] PyCqBot: api 发生错误 SEND_MSG_API_ERROR: send group message failed: blocked by server code: 100
丢给cloud后:
这段日志显示:
===================
这个需要怎么解决?
我想在linux服务器上一直挂起这个bot,我买的服务器怎么使用vpn呢?我在本地window可以使用,但是不能一直开机呀
我在安装的过程中,使用的是神灯VPN,但是这个VPN我只知道ip,不知道端口,代理服务器的话我只知道ip,不知道端口。这样的话,配置文件该怎么写。
[2023-05-10 19:52:51,495][MainThread/WARNING] PyCqBot: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000024448B1E3B0>, 'Connection to 50.114.56.133 timed out. (connect timeout=600)')': /v1/chat/completions
[2023-05-10 19:53:12,698][MainThread/WARNING] PyCqBot: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000024448B1E5F0>, 'Connection to 50.114.56.133 timed out. (connect timeout=600)')': /v1/chat/completions
Internet issues! Will not answer this time.
,连接节点查了ip和端口号,用的是免费的chatgpt的接口,求助,调了一下午了,
在运行qqbot.py时,出现了以下报错
Traceback (most recent call last): File "D:\Spit_chatBot\qqbot.py", line 11, in <module> from pycqBot.cqApi import cqHttpApi, cqLog ImportError: cannot import name 'cqHttpApi' from 'pycqBot.cqApi' (C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\pycqBot\cqApi.py)
启动qqbot.py之后提示配置文件不合法
能不能加一个在配置文件里添加前缀关键词然后
如果在输出之前识别到将要输出的文字前几个字符包含这个前缀则自动删除这个前缀的功能
非常感谢🙏
UP主你好,我很感谢你分享了这个有趣的项目。我在使用它的时候遇到了一个问题,希望你能帮我解决。当我运行Spit_chatBot时,我收到了一些错误提示,如下:
[2023-05-24 23:00:41,774][MainThread/WARNING] PyCqBot: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /v1/chat/completions
[2023-05-24 23:00:42,014][MainThread/WARNING] PyCqBot: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /v1/chat/completions Internet issues!
Will not answer this time.
当前进程pid: 5528
#################################################################
██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ████████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██╔═══██╗██╔══██╗██╔═══██╗╚══██╔══╝
██████╔╝ ╚████╔╝ ██║ ██║ ██║██████╔╝██║ ██║ ██║
██╔═══╝ ╚██╔╝ ██║ ██║▄▄ ██║██╔══██╗██║ ██║ ██║
██║ ██║ ╚██████╗╚██████╔╝██████╔╝╚██████╔╝ ██║
╚═╝ ╚═╝ ╚═════╝ ╚══▀▀═╝ ╚═════╝ ╚═════╝ ╚═╝
v0.5.1.1 BY FengLiu
#################################################################
[2023-05-25 12:34:15,409][go-cqhttp/ERROR] PyCqBot: go-cqhttp 发生致命错误 open cache image db failed: The process cannot access the file because it is being used by another process.
这个就是问题的输出,在图片缓存库。
Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\JhotTest\Spit_chatBot-main\Spit_chatBot-main\qqbot.py", line 11, in
from pycqBot.cqApi import cqHttpApi, cqLog
ImportError: cannot import name 'cqHttpApi' from 'pycqBot.cqApi' (C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pycqBot\cqApi.py)
upup,孩子试了大半天,还是有这个错误,到底怎么办呐
[2023-05-11 01:39:51] [INFO]: 正在检查协议更新...
Protocol -> connect to server: 58.212.179.125:8080
[2023-05-11 01:40:06] [ERROR]: Protocol -> unexpected disconnect: EOF
[2023-05-11 01:40:06] [INFO]: Protocol -> connect to server: 180.102.191.69:8080
[2023-05-11 01:40:07] [ERROR]: Protocol -> unexpected disconnect: EOF
[2023-05-11 01:40:07] [INFO]: Protocol -> connect to server: 180.109.192.45:8080
[2023-05-11 01:40:08] [ERROR]: Protocol -> unexpected disconnect: EOF
[2023-05-11 01:40:08] [INFO]: Protocol -> connect to server: 117.62.242.81:8080
[2023-05-11 01:40:09] [ERROR]: Protocol -> unexpected disconnect: EOF
[2023-05-11 01:40:09] [INFO]: Protocol -> connect to server: [::ffff:123.151.54.194]:443
[2023-05-11 01:40:10] [ERROR]: Protocol -> parse incoming packet error: return code unsuccessful: -10005
[2023-05-11 01:40:22] [ERROR]: Protocol -> parse incoming packet error: return code unsuccessful: -10005
查看pdf后发现里面需要admin_qq, bot_group_info这两个信息,请问这两个该使用的是什么qq和信息。是bot的QQ吗
期待您的回复
API Key
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.