(discord.py) Economy data - Replit DB?
meziosaur

Hello
I needed some guidance, I wanted to save 4 kinds of currencies per user into a replitDB.

I'm kinda lost and not sure where to start with it.
Would I need a key per user like so:
(User_id)(coin_id)=amount

It's this the right train of thought?

You are viewing a single comment. View All
Coder100

How about this:

remember to treat it like a dict.

OldWizard209

Are you sure you can access a value in a dictionary in Python using a dot notation? You are using the concept of JavaScript Objects in this example:

db[user.id]
@Coder100

Coder100

well it was a semantic example after all @OldWizard209

Coder100

but from what i can tell id is a property of the class user @OldWizard209

OldWizard209

Well if it is a property then you were right but as a general example, it should be best to do db[user][id]. Also, the user(question asker) said they were using multiple currencies so it would be better to save a dictionary as a value in the db, containing all the currencies.
@Coder100

Coder100

yes that is what i did did you not see @OldWizard209