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

Problems with discord authentication #3

Closed
Khyretos opened this issue Dec 1, 2020 · 6 comments
Closed

Problems with discord authentication #3

Khyretos opened this issue Dec 1, 2020 · 6 comments
Assignees
Labels

Comments

@Khyretos
Copy link

Khyretos commented Dec 1, 2020

Bot has a problem when connecting to discord here is a screenshot.

image

it says it has problems with the token for some reason.

here the log file:
import logging
loglevel = 20

def setlevel(level):
global loglevel
loglevel = int(level)

def log(msg, level="info"):
if level == "debug" and loglevel <= 10:
print("[DEBUG] " + msg,flush=True)
logging.debug(msg)
elif level == "info" and loglevel <= 20:
print("[INFO] " + msg,flush=True)
logging.info(msg)
elif level == "warning" and loglevel <= 30:
print("[WARNING] " + msg,flush=True)
logging.warning(msg)
elif level == "error" and loglevel <= 40:
print("[ERROR] " + msg,flush=True)
logging.error(msg)
elif level == "critical" and loglevel <= 50:
print("[CRITICAL] " + msg,flush=True)
logging.critical(msg)

@WoophRadu
Copy link
Owner

WoophRadu commented Dec 1, 2020

Please make sure you are setting your Bot's Token correctly. You need the Bot Token, not the Client Secret! It's easy to confuse the two.

Go to the Discord Developer Portal, create an application there or select the one you already created. Then, on the right, you will have a tab that says "Bot". Make sure you have a Bot, and if not, click Add Bot. That will create a Discord Bot account. There, you will find a field that says TOKEN. You copy that, and you paste it into your config.

Find your Token here:
image

Please confirm you're not mistaking it for the client secret, which is found here:
image
This is the wrong one!

@WoophRadu WoophRadu self-assigned this Dec 1, 2020
@Khyretos
Copy link
Author

Khyretos commented Dec 1, 2020

yea i did that but it still has issues.

image

i have several bots that i self host so i know which token i needed to paste but its still presenting problems for some reason, i also gave the bot admin permisions just in case
image

WoophRadu added a commit that referenced this issue Dec 1, 2020
@WoophRadu
Copy link
Owner

WoophRadu commented Dec 1, 2020

I added better clarity for the issue in the logs, in commit dde2fae. Please update (redownload or pull the repo), and try again. Please also paste the correct log (file "bot.log", not "logger.py"), so I can better understand the problem :)

@Khyretos
Copy link
Author

Khyretos commented Dec 1, 2020

now i get this:
image

and here is the log:
[INFO @ 2020-12-01 09:55:55 PM] --- INITIALIZING ---
[WARNING @ 2020-12-01 09:55:55 PM] Config file config.ini not found, generating a new one from default_config.ini
[INFO @ 2020-12-01 09:55:56 PM] Logged into reddit as /u/kiewirevo
[WARNING @ 2020-12-01 09:55:56 PM] PyNaCl is not installed, voice will NOT be supported
[INFO @ 2020-12-01 09:55:56 PM] logging in using static token
[INFO @ 2020-12-01 09:55:56 PM] Cleaning up tasks.
[INFO @ 2020-12-01 09:55:56 PM] Closing the event loop.
[CRITICAL @ 2020-12-01 09:55:56 PM] There was an error while connecting the bot to Discord. Either your login token is invalid, or idk. Exiting in 5 seconds.
[CRITICAL @ 2020-12-01 09:55:56 PM] Exception passed: <class '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:1122)')]

@WoophRadu
Copy link
Owner

This seems to be an issue outside of my control, either with the SSL certificates that are included with your version of Windows or Python. See Rapptz/discord.py#4159 (comment) and try following those instructions, or the other ones in that issue.

@Khyretos
Copy link
Author

Khyretos commented Dec 2, 2020

THANK YOU!!!!, it worked
image

@Khyretos Khyretos closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants