Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem Connecting to Discord #5100

Closed
TheS1mp opened this issue Jul 5, 2020 · 4 comments
Closed

Problem Connecting to Discord #5100

TheS1mp opened this issue Jul 5, 2020 · 4 comments
Labels
duplicate This is a duplicate of another issue or PR.

Comments

@TheS1mp
Copy link

TheS1mp commented Jul 5, 2020

Hello, I am currently trying to code a bot for my discord server, but when I ran the following code it didn't seem to work:

import discord

client = discord.Client()

client.run("token")

Before I get asked this, yes I did input the token.
When I run this code though I get the following error

File "/Users/Me/Desktop/Discord Bot/bot.py", line 5, in <module>
    client.run("token")
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 640, in run
    return future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 621, in runner
    await self.start(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 584, in start
    await self.login(*args, bot=bot)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 442, in login
    await self.http.static_login(token.strip(), bot=bot)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/http.py", line 261, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/http.py", line 165, in request
    async with self.__session.request(method, url, **kwargs) as r:
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 483, in _request
    timeout=real_timeout
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 859, in _create_connection
    req, traces, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 1003, in _create_direct_connection
    raise last_exc
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 985, in _create_direct_connection
    req=req, client_error=client_error)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 940, in _wrap_create_connection
    raise ClientConnectorSSLError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorSSLError: Cannot connect to host discordapp.com:443 ssl:default [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)]

For more help, I am on a mac, so please make sure any answers work on Mac OS

@thecaralice
Copy link

Navigate to your Applications/Python 3.X/ folder and double click the Install Certificates.command to fix this

@TheS1mp
Copy link
Author

TheS1mp commented Jul 5, 2020

Thank you very much, that did it!

@thecaralice
Copy link

You should close the issue

@Harmon758
Copy link
Contributor

Duplicate of #423

@dpy-manager-bot dpy-manager-bot added the duplicate This is a duplicate of another issue or PR. label Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This is a duplicate of another issue or PR.
Projects
None yet
Development

No branches or pull requests

4 participants