What does db.get() return?
ThatGhost (41)

So, here is the background on my issue:
I am making a discord bot for my server. It has a dashboard and everything.

I am making a captcha system right now, and for some reason, if o do:

if the user types the wrong captcha, it sends the message, but, if the user types the right captcha, it still sends the message.

i define the code variable the line before, this is where the issue lies.

I am using replit's build in db, i tried logging it.

we send in numbers and get whatever it returns, but what does it return?

if its a promise, all i need to do is make the function asynchronous and add resolve it using await

but if its an object i need to somehow view the json object.

if you need my code, go in the commands folder and open verify.js

You are viewing a single comment. View All
Coder100 (19279)

db.get returns a promise, meaning it takes time for the function to execute.
What you have to do is something like this:

DO NOT FORGET THE ASYNC ON LINE 1
it is required for the await syntax.

ThatGhost (41)

@Coder100 ok, thats what i thought. Thanks!