@bot.slash_command()
async def balance(ctx, user: discord.User = None):
if user != None:
userid = user.id
else:
userid = ctx.author.id
with open("users.json", "r+") as f:
data = json.load(f)
if str(userid) in data:
balance = data[str(userid)]["balance"]
await ctx.channel.respond(
f"{ctx.author.mention} has **⏣{balance}** in their wallet."
)