I'm making a discode bot with Python, but there's an error. Help me

Asked 2 years ago, Updated 2 years ago, 14 views

Run in cmd.If you py, it will be executed to some extent

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\owner\Desktop\run.py", line 17, in <module>
    client.run('NzkyMzM2MTc3NDM5OTY1MTg0.X-cOkQ.EjIWejkMUJb3xQjFThDblHrAz-8')
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\discord\client.py", line 708, in run
    return future.result()
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\discord\client.py", line 687, in runner
    await self.start(*args, **kwargs)
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\discord\client.py", line 650, in start
    await self.login(*args, bot=bot)
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\discord\client.py", line 499, in login
    await self.http.static_login(token.strip(), bot=bot)
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\discord\http.py", line 291, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\discord\http.py", line 185, in request
    async with self.__session.request(method, url, **kwargs) as r:
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\client.py", line 480, in _request
    conn = await self._connector.connect(
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py", line 858, in _create_connection
    _, proto = await self._create_direct_connection(
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py", line 1004, in _create_direct_connection
    raise last_exc
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py", line 980, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "C:\Users\owner\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py", line 938, in _wrap_create_connection
    raise ClientConnectorCertificateError(
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)')]

It pops up like this.

For your information, I made the chords like this.

import discord

client = discord.Client()

@client.event
async def on_ready():
    print('We have logged in as {0.user} '.format(client))

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

    if message.content.startswith('!ping'):
        await message.channel.send('pog')

client.run('PyongPyongToken')

python

2022-09-20 19:14

1 Answers

aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1124)')]

It seems like an SSL certificate error rather than a code problem. Let's take a look at the expiration date according to the error message.


2022-09-20 19:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.