discord.py bot clientconnectorcertificateerror运行时出错

zysjyyx4  于 2021-08-25  发布在  Java
关注(0)|答案(1)|浏览(371)

我正在和我的朋友们参加一个以discord机器人游戏为主题的编程比赛。我设法编写了一个基本的启动程序,但每次我尝试运行到目前为止测试它的代码时,都会出现clientconnectorcertificateerror错误。以下是我的代码:

import os
import discord

from dotenv import load_dotenv
from discord.ext import commands

load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')

bot = commands.Bot(command_prefix="$")

@bot.event
async def on_ready():
    print(f'{bot.user.name} has sucessfully connected to Discord!')

@bot.event
async def on_message(message):
    if message.author == bot.user:
        return

bot.run(TOKEN)

有人知道如何解决这个问题吗(令牌位于单独的文件中)
以下是整个回溯:

Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')]
zzlelutf

zzlelutf1#

Windows:
转到开始,键入internet explorer。以管理员身份运行。
去做https://discord.com 点击挂锁图标。
单击“查看证书”
单击安装证书,选择用户或本地计算机。
单击将所有证书放置在以下存储中
选择受信任的根证书颁发机构
在github问题上查看此问题
看看这个

相关问题