Discord.py different values for variable

I want to make a balance command in python, but how do i make it so that the money variable is different for everyone? Like, when someone earns money, only change the variable value for the author of the message, and not the actual global value of the variable. Sorry if this sounds like a stupid question, i’m new to python.

@bot.command(name='python_bal')
async def anothercommand(ctx):
    await ctx.send(MONEY)
@bot.command(name='python_change')
async def yetanothercommand(ctx):
    global MONEY
    MONEY = MONEY + 1
    await ctx.send(MONEY)

You should check the source code of GitHub - Stylix58/pydisaur: A URL Shortener for Discord..
Its uses a simple db system!

Isn’t there a simpler way to do this? Like, only changing the variable for the current author of the message and not globally?

Nevermind, i’ll just be using JSON data to store everything

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.