My app (mmotivate) cannot connect to Discord


#1

I’ve been tinkering with making a Discord bot and it was going great. I mean, I made a big booboo and accidentally uploaded the token to github and someone briefly hijacked my bot, but Discord roles prevented any damage.

After that, I changed the token, took off the exposed token from github, and was able to get back to work just fine. That is until, suddenly, I get this error that refused to ever ever go away, even when I commented out basically the entire app (again, mmotivate):

I suspect that the amazon server my application was on was blacklisted by Discord, as that seems to be happening a lot to folks here as of recent. I may need my project moved.


#2

Thanks for the project name - we’ll take a look.


#3

Thanks! Keep me posted about how it goes.


#4

Hello, so I can’t seem to find your project. I found a project called mmotivate but it was from a different person. Either way, what you’re getting right now is a warning.
Not an error, it is saying that you are using a Promise but never handling what would happen if that promise returns back as a failure.


This is a good link with explanation as to how Promises work. Let me know if this was any help at all.


#5

Nah, mmotivate is indeed mine! I just use a different username on here. The user icon is yellow and orange checkerboard, right? That’s me.Sorry about the confusion!

Thing is, I’ve read up that it’s a warning. However, my bot doesn’t come online. At all. I even rewinded to a version which SHOULD have worked fine. Still get a rejection from the API. Bot still doesn’t come online. So it’s not a promise as much as I think discord banned the server my app happens to reside on.

The token should be still good, so if you can go check out the project and see if you can get it to work, be my guest! I’m just super skeptical it’s an issue of promises.


#6

Have you tried moving your code for server.js to testbot.js? or vice versa?
From what I can tell, and I may be wrong, it seems as though the code from server.js is never being run which is never calling the express server.

Also make sure that everything in server.js is not being commented out. And if you move the code from testbot.js to server.js you will need to change package.json to call server.js instead of testbot.js.


#7

Oh! Everything there is just the common Glitch placeholders for a project. It’s not needed AT ALL for my code to work. As for why the bot doesn’t boot on start, I wanted to manually start and stop it just in case I had to do some directory shenanigans.

If the bot loads correctly, it’ll print out some info about the test Discord server I’m on. Just me, the bot, Clyde (placeholder Discord bot, usually invisible), and an additional tester.


#8

It’s not the token, by the way! I’ve gotten token errors before while it WAS working, and the error I’m getting now is most definitely not the same. Discord would ping back a bad token.


#9

Okay so after some testing It seems that the warning was coming from your client.login(token). It was failing and the failure wasn’t being handled in a catch block.
I think the first step to try to fix this might be resetting your token again and updating the token in your .env


#10

Already did it! Saw you editing the token, so I made a new one once you left.


#11

So after some back and forth, it DOES seem like it’s a server/Discord blacklist issue. Note I’ve already made a remix of the app I’m having trouble with now, only to have it have the exact same error/issue. I may need admin help.


#12

Welp I could not help much, Tried resetting the token, added a catch block to client.login() which got rid of warning but client.login() keeps failing. :persevere:
Hopefully Mod can figure it out :smile:


#13

We’ve moved it for you!


#14

Ah geez. Even though it’s moved, it still seems like I’m getting the same error, even WITH a catch:

I’m not sure what’s the issue anymore. This is frustrating. Is there any way for me to know EXACTLY what’s going wrong? I tried looking into the Discord error’s error code, but it’s just blank. I’m completely in the dark.


#15

If you DM me a join link, I can take a look.


#16

Okay, I sent you the link!


#17

Thanks, dude! What did you do to fix it? I don’t see a difference in my code.


#18

A little snafu moving you over, sorry about that - you should be back in action now!


#19

Thanks! I appreciate your help and the time you put in! Love this service so far.