【发布时间】:2021-04-28 16:51:02
【问题描述】:
我正在尝试创建一个命令 ( 它没有给出任何错误,但它也完全没有响应。 感谢您的帮助!@client.command()
@commands.has_permissions(administrator = True)
async def MF_add(ctx, user: discord.Member):
with open ("MF Points.json", "r") as f:
users = json.load(f)
await client.get_user(user_id)
user = client.get_user(user_id)
if user in users:
users["{user.mention}"]["points"] += 1
await ctx.message.channel.send(f"You have given {member.mention} 1 MF point.")
with open("MF Points.json", "w") as f:
json.dump(users, f, indent = 4)
【问题讨论】:
-
等待消息发送真的在发送吗?
-
不,当我在 Discord 中尝试机器人时没有任何反应
-
我想你忘了加
bot.command() -
糟糕!不,它就在那里。刚刚在我的帖子中输入错误。
-
尝试使用
if user in users.items():
标签: python json discord discord.py