【发布时间】:2021-12-23 07:49:19
【问题描述】:
我正在使用 repl 的数据库函数制作一个不和谐的 python 机器人,但我不知道如何从数据库中只删除一个值。
@client.command()
async def addvalue(ctx, arg):
db[str(ctx.author.id)] = [arg]
await ctx.send("value added")
@client.command()
async def removevalue(ctx, arg):
db[str(ctx.author.id)] = db[str(ctx.author.id)] - arg #ik this is a dumb way of trying this, i tried like a hundred diff ways nothing works.
【问题讨论】: