so the thing is, i'm making a discord bot in python with python.py and i'm making a command to mute someone by put their user id in a json file.
@client.command()
async def mute(user):
with open("muted.json", 'r') as f:
data = json.load(f)
if not user.id in data:
data[user.id] = {}
else:
await client.send_message(message.channel, "The user is already muted")
It's saying at "if not user.id in data:" that "AttributeError: 'str' object has no attribute 'id'" How can I fix that ?
'user.id'
instead ofuser.id
(in both occurences). – Dinari