Comments (7)
使用快速启动quickStart.py
也遇到了报错
>python quickStart.py Text
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache
Loading model cost 1.305 seconds.
Prefix dict has been built successfully.
Testing started.
Enter a message and press enter to interact.
amiya
[2021-03-07 12:56:47][group][GID 1061935528][UID 736458622][administrator] amiya
Traceback (most recent call last):
File "D:\Python18\lib\site-packages\urllib3\connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "D:\Python18\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "D:\Python18\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python18\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "D:\Python18\lib\site-packages\urllib3\connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "D:\Python18\lib\http\client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:\Python18\lib\http\client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:\Python18\lib\http\client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Python18\lib\http\client.py", line 1004, in _send_output
self.send(msg)
File "D:\Python18\lib\http\client.py", line 944, in send
self.connect()
File "D:\Python18\lib\site-packages\urllib3\connection.py", line 187, in connect
conn = self._new_conn()
File "D:\Python18\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000016D6C5B0880>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python18\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "D:\Python18\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "D:\Python18\lib\site-packages\urllib3\util\retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=8080): Max retries exceeded with url: /uploadImage (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000016D6C5B0880>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "quickStart.py", line 46, in <module>
on_message(message_text, config['admin_id'], config['close_beta']['group_id'])
File "quickStart.py", line 10, in on_message
message.on_message({
File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\messageHandler.py", line 116, in on_message
result = action['func'](self_data)
File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\replies\faceImage.py", line 27, in face_image
return Reply(Image(path), at=False)
File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\messageType.py", line 42, in __init__
image_id = imageManager.image(path, 'group')
File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\modules\resource\imageManager.py", line 26, in image
return self.requests_image_id(resource, file_path, image_type)
File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\modules\resource\imageManager.py", line 45, in requests_image_id
response = self.request.post(self.url('uploadImage'), data=multipart_data, headers=headers)
File "D:\Python18\lib\site-packages\requests\sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "D:\Python18\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "D:\Python18\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "D:\Python18\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=8080): Max retries exceeded with url: /uploadImage (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000016D6C5B0880>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))
from amiya-bot.
是否可以提供一下你的config.json,请删除个人敏感信息
from amiya-bot.
mirai-http-api的setting.yml
cors:
- '*'
host: 0.0.0.0
port: 8080
authKey: Wmy2005eithteen
cacheSize: 4096
enableWebsocket: false
report:
enable: false
groupMessage:
report: true
friendMessage:
report: true
tempMessage:
report: true
eventMessage:
report: true
destinations: []
extraHeaders: {}
heartbeat:
enable: false
delay: 1000
period: 15000
destinations: []
extraBody: {}
extraHeaders: {}
amiya的config.json
{
"self_id": 123,
"self_passwords": "***",
"admin_id": 736458622,
"mirai_ok": false,
"auth_key": "Wmy2005eithteen",
"server": {
"server_ip": "0.0.0.0",
"server_port": 8080
},
"database": {
"host": "localhost",
"port": 3306,
"user": "root",
"password": "***",
"db": "amiya"
},
"baidu_cloud": {
"enable": false,
"app_id": "",
"api_key": "",
"secret_key": ""
},
"message": {
"limit": {
"seconds": 10,
"max_count": 3
},
"reply_text_max_length": 100
},
"close_beta": {
"enable": false,
"group_id": 1061935528
}
}
from amiya-bot.
请将amiya的config中"server_ip": "0.0.0.0"
字段值更改为127.0.0.1
,0.0.0.0
仅能在服务器上使用,表示接受从任何ip地址发送的请求。为了安全起见建议将mirai的监听ip也更改为127.0.0.1
。127.0.0.1
表示本机地址,这样应该可以解决quickstart的问题,请修改后检查python amiya.py
是否仍会报错。
from amiya-bot.
更改为127.0.0.1
后可以连接了,admin账号收到了启动完毕
的消息,但是在群聊尝试发送命令时并无反应,控制台有接收消息。
在发送启动完毕
消息后,控制台有报错消息,如下
2021-03-07 13:20:29 V/Bot.923594412: Friend(736458622) <- 启动完毕
2021-03-07 13:20:29 E/net.mamoe.mirai-api-http: kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelling}@1c5ff70
kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelling}@1c5ff70
2021-03-07 13:20:29 W/stderr: SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
2021-03-07 13:20:29 W/stderr: SLF4J: Defaulting to no-operation MDCAdapter implementation.
2021-03-07 13:20:29 W/stderr: SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
from amiya-bot.
请将miral的setting中enableWebsocket: false
的值改为true
,本项目实际上是一个websocket客户端
from amiya-bot.
成功了。enableWebsocket
我改过一次,然后启动后命令行狂刷Server not found.
,于是改了回去。
看来教程又要改一下子了
from amiya-bot.
Related Issues (20)
- 适应手机的图片比例与尺寸 HOT 1
- 一个关于实例IP变化导致的bug HOT 8
- 加载了不存在的插件 HOT 2
- [插件BUG]词语替换1.3 BUG AttributeError: 'Message' object has no attribute 'text_origin' HOT 1
- 求助:控制台-管理员无法使用,在安装词语替换后恢复,控制台无报错日志 HOT 7
- 在WindowsServer2016/2019上尝试安装插件时SSL相关字样下载失败 HOT 3
- 部署出错 HOT 2
- 兔兔互动插件报错 HOT 2
- 语音文件下载失败 HOT 1
- 唤起兔兔,兔兔无响应 Got Code 404 HOT 1
- 安装插件出错 HOT 3
- 安装程序出错 HOT 9
- AmiyaBot Console的跨域问题 HOT 7
- 明日方舟干员资料报错 HOT 7
- assets download failed HOT 1
- 官方的关卡查询插件2.1里面的敌人图片不显示 HOT 2
- 字典合并问题 HOT 1
- 请问,能否使用red部署QQ群机器人?如果不能,请问作者是否有计划添加使用red部署QQ机器人的方法? HOT 4
- 卸载插件时展示依赖关系 HOT 2
- 部署相关的的提议 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amiya-bot.