python task_bot.py运营报错问题
gaofeng2022 opened this issue · comments
报错主要有两个原因:1、无法连接discord,telnet discord.com 443,显示无法连接。解决办法:果断换梯子,可以试试https://steampp.net/。2、discord bot配置问题,打开https://discord.com/developers/applications,
,开启:SERVER MEMBERS INTENT 问题完美解决。
MESSAGE CONTENT INTENT
是这个吧
通过这个api发的消息,会展现在 discord的频道中吗?
我的还继续报错
有解决方案了吗 按上面的尝试了 还是报错
Cannot connect to host discord.com:443 ssl:default [Connection reset by peer]
Traceback (most recent call last):
File "D:\code\third_party\midjourney-api\task_bot.py", line 13, in
bot.run(BOT_TOKEN)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\discord\client.py", line 860, in run
asyncio.run(runner())
File "C:\Users\TT\anaconda3\envs\mjapi\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\discord\client.py", line 849, in runner
await self.start(token, reconnect=reconnect)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\discord\client.py", line 777, in start
await self.login(token)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\discord\client.py", line 612, in login
data = await self.http.static_login(token)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\discord\http.py", line 801, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\discord\http.py", line 624, in request
async with self.__session.request(method, url, **kwargs) as response:
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\client.py", line 1167, in aenter
self._resp = await self._coro
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\client.py", line 562, in _request
conn = await self._connector.connect(
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\connector.py", line 1209, in _create_direct_connection
raise last_exc
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\connector.py", line 1178, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "C:\Users\TT\anaconda3\envs\mjapi\lib\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host discord.com:443 ssl:default [信号灯超时时间已到]
我这里会出现这个问题,是同样的问题吗