spifory / tags

A Discord bot that helps with previewing your Meta/OpenGraph tags before you use them on your site.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[API] Properly handle non-BigInt authorID's

spifory opened this issue · comments

There should be some proper error handling for this. I initially did it like this because I was lazy, and once again to get the actual bot and API working.

The way it currently does it works, but it's quite hard to understand. It should at least specify that it needs a BigInt and not a random string instead of doing what it currently does.

// it will error when a BigInt is not a BigInt and then turn it into a string again
// just so that it can go in to the database correctly
// I have no idea why I'm doing it like this
authorID: String(BigInt(data.authorID)),