python - 如何解决python中的客户端连接器错误?
问题描述
我有下面的代码
我正在为不和谐写一个机器人
但我得到错误
" Exception has occurred: ClientConnectorError Cannot connect to host discord.com:443 ssl:default [The specified network name is no longer available]
"
在最后一行
代码:
import discord
import os
client = discord.Client()
@client.event
async def ready1():
print('we have logged in')
@client.event
async def hello(message):
if message.author==client.user:
return
if message.content.contains('hello'):
await message.channel.send('hello')
client.run(token)
解决方案
我只是重新生成令牌并且它有效
推荐阅读
- ios - FPS App在编译时崩溃,“线程1:Swift运行时失败:范围需要lowerBound <= upperBound”错误
- amazon-web-services - 从golang上传签名的url:SignatureDoesNotMatch
- python - 为什么在 Airflow 2.0 中从 TriggerDagRunOperator 中删除了“python_callable”选项?
- woocommerce - Woocommerce 在简要说明下方添加产品重量
- git - 撤消已发布的合并并重新应用原始更改而不重写历史记录
- r - 尽管 set.seed - 我得到的结果与 R 中的其他人不同
- javascript - 如何让 Insomnia 接受带有换行符的字符串?
- javascript - Modelviewer 未加载本地文件“不允许加载本地资源”
- python - 不理解 processing.py 的错误
- python - Matplotlib 中非等距值的等距刻度