0
votes

If I run the following code in python, I get an error.

import discord
from discord.ext import commands

TOKEN = "token"

client = commands.Bot(command_prefix = "rps/")

@client.event
async def on_ready():
    print ('ready')

client.run("token")

error:

Traceback (most recent call last): File "/Users/timothy/Library/Python/3.6/lib/python/site-packages/aiohttp/connector.py", line 822, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 804, in create_connection sock, protocol_factory, ssl, server_hostname) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 830, in _create_connection_transport yield from waiter File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 505, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 201, in feed_ssldata self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)

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

Traceback (most recent call last): File "/Users/timothy/Documents/coding stuff/python/Test bot/test bot.py", line 12, in client.run(TOKEN) File "/Users/timothy/Library/Python/3.6/lib/python/site-packages/discord/client.py", line 571, in run return task.result() File "/Users/timothy/Library/Python/3.6/lib/python/site-packages/discord/client.py", line 478, in start

I think it's to do with how I installed the package using $conda install discord.py. Does anyone know what I did wrong? python does recognise the module

1
Don't ever publish access tokens. Go rotate your tokens so what you posted is revoked.Chase
Chase I know I changed the token afterTimothy Harris

1 Answers

0
votes

Try installing the discord.py module with pip ('pip install discord.py')!