每次尝试从数据库中提取有关用户的信息都会返回None
我的代码:
@bot.command()
async def warnings(ctx, user:discord.Member = None):
client = MongoClient('connection')
db = client.gettingStarted
collection = db.Warning
if user == None:
await ctx.send('Please give a valid user')
else:
x = collection.find_one({"id":f"{user.id}"})
print(x)
有什么问题吗
试着改变
到
如果不起作用,请告诉我
相关问题 更多 >
编程相关推荐