My Profile Photo

Bencey's Blog


Informing the world about the application of Technology.
If you are looking for Tier III Technologies click the button below


Bot Token Regen

Token reset

Do you remember how bots have tokens?, well have I ever mentioned to you that the tokens can reset if the bot restarts itself 1000 times?. Well, this happened to me today and its quite a funny story so I’ll tell it to you guys so you never make the same mistake as I did. So this morning at about 8:30 I noticed by bot was offline which was strange at the time because my bot never goes offline because it is hosted on a VPS, so I quickly took a look at the logs to see what was wrong but I could not understand what the error was but at the time I was getting ready for school so I had to log off and leave. Over the day I kept looking at the logs and talking to some support team they couldn’t help because it wasn’t “Related” to what their server is about. So after a few hours of looking, I gave up but just before school finished I recognized something in one of the lines of the error code “Incorrect login details were provided”. So I thought to myself “Maybe my token regenerated” so I went over to discordapp.com/developers and just as I thought my token regenerated itself, Stupid me. And then I decided to check my emails to see if I have received an email about a cub leader meeting I am going to tonight and right up the top of my email list was an email from discord which I received at 7 am that morning and it said

Hey Bencey_,

It appears your bot, Bencey Bot, has connected to Discord more than 1000 times within a short time period. Since this kind of behavior is usually a result of a bug we have gone ahead and reset your bot’s token.

Well then… If only I read my emails this morning the problem would have been quite obvious, I hope you all learn from this lesson of mine and make sure you check your token and emails if your bot does not boot up correctly. And if you were wondering, no you cannot disable the automatic regeneration discord has put it this way to prevent API abuse and so the API does not get spammed with bad requests due to nonfunctioning code

Thanks for reading

Bencey