Ask coding questions

← Back to all posts
Discord bot error with Replit DB
yash1441 (0)
db.get(message.author.id).then(value => {
			if (value == null) message.reply("Please use !setid *<your game id>* to set your Game ID first.");
			else message.reply("Your Game ID is **" + value + "**");
		});

This piece of code had been working fine for an year now but suddenly started giving the error as follows out of the blue.

(node:14079) UnhandledPromiseRejectionWarning: SyntaxError: Failed to parse value of 132784173311197184, try passing a raw option to get the raw value

I tried entering raw key to db.get instead of message.author.id but it had the same error. Can anyone guide me as to why is the value of that key not getting parsed? I already tried many more of the keys and no value gets parsed.

Comments
hotnewtop
yash1441 (0)

Seems like the database URL changes every month for security purposes. So if I want to use it externally then I have to regenerate it once every month.

[deleted]

What DB are you using?

[deleted]

@yash1441 do you have a parser?

yash1441 (0)

@novaflippers In the code of @replit/database it parses it inside the .get function itself.