I'm using pickledb and discord.ext, and I'm trying to store separate data for each user. How would I do that?
import discord
import random
import pickledb
from datetime import datetime
from discord.ext import commands
import math
crun = True
db = pickledb.load('discord.db', True)
@bot.command()
async def test(ctx):
global token
crun += 1
await ctx.reply(f'you have run this command {crun} times.')
bot.run(TOKEN)
EDIT: how would i do it with something like this?
@bot.command(aliases=["classpick mage"])
async def classpick(ctx):
classpicked = str(ctx.author)
embed = discord.Embed(title="class = \"mage\"", description="here are your stats.", color=discord.Color.random())
embed.add_field(name="magic_attack = ", value="15")
embed.add_field(name="melee_attack = ", value="5", inline=True)
embed.add_field(name="magic_defense = ", value="1", inline=True)
embed.add_field(name="melee_defense = ", value="0", inline=True)
embed.add_field(name="max_health = ", value="90", inline=True)
embed.add_field(name="starting_skill = fireball", value="fireball", inline=True)
embed.add_field(name="You are now a mage! do \"q adventure\" to start!", value="w", inline=True)
print(db.get(classpicked))