2

Me and my friend were doing a discord bot using an extensions that allow us to collaborate.

We were making the bot with Node JS and. Something so horrible happened.

While making a purge function wich should remove the last messages of the discord we met a problem. When you do !purge 1
It were removing 11 messages.

The problem were that in my code i were adding 1 (int) to a string (my amount of message to remove) so it result 11 as string....

This is JAVASCRIPT

I don't know if this were a bug but being able to add 1 (int) to 1 (string) it's fucking dumb. It should result an error not making it as string!

Comments
  • 0
    @AlexDeLarge Well, Python also gives you such "freedom", but raises error when you do it without thinking it through. You have to cast int to str to concatenate or cast str to int to sum them. And that is how it should be done in every language - it should do exactly what you tell it to do, not assume their own way of doing stuff.
Add Comment