I am writing a discord bot in typescript and can't seem to retrieve data. I can see the user ids in the JSON.sqlite file but I can't figure out why it returns null
when I retrieve data. If you want to see my code I have it on Pastebin with a couple of comments.
Having trouble getting values using quick.db in discord.js (Typescript)
675 Views Asked by Stale At
2
The line
is wrong. You probably want
Reason:
${}
is making a template string, which indeed puts the variable into a string, however, you don't need to do this as passing in the value in the first place will do it anyways. However, you are trying to access themoney
property frommsg.author_id
, which doesn't exist. Therefore, it returns null and SQLite can't find anull
entry.