Quick.db problems getting the information of a key replied to me

The key is called “dungeon”. In the code I wrote:

message.channel.send(db.get("dungeon"));

and this is what the bot answers me:

[object Object] 

Moderators aren’t answering in the support server…

let dungeon = await db.fetch(`dungeon`);
await message.channel.send(dungeon);

[object Object] means you sent an array or a json instead of a text

How to make it text?

Idk how to use that, can u make an example?

Can you copy and paste here the value of dungeon ?

dungeon{“town”:“A3”,“A1”:“B3,town”,“A2”:“B2,town”,“A3”:“B1,B2,B3,town”,“B1”:“C1,A3”,“B2”:“C3,C2,A2,A3”,“B3”:“C3,C1,A1,A3”,“C1”:“D1,D2,B1,B3”,“C2”:“D1,D2,B2”,“C3”:“D1,D2,B2,B3”,“D1”}

Yeah, that’s a JSON, you can’t send a JSON as JSON in a Discord message. But if you really want to send it you can make the JSON a string, it will send the JSON as a string.

how to do that? .toString()?

JSON.stringify(dungeon)

2 Likes

THHHHXXXX With that, I could realize what’s was my main problem! Now my bot is complete!

1 Like