Using await client.kick(userid), where user id = user input, and i am getting
yield from self.http.kick(member.id, member.server.id)
AttributeError: 'str' object has no attribute 'id'
I have tried everything i could think of, idk what the issue is.
my full code section is
if message.content.startswith('!kick '):
userid = message.content.split(' ', 1)[1]
print(userid)
msg = 'User has been kicked.'.format(message)
await client.send_message(message.channel, msg)
await client.kick(userid)
client.kick does not take a user id as an argument but a member object.
If you wanted to use method like this you would need to use the server.get_member() method. Where server is the server object you wish to kick the user from.
Questions like this are better suited to the discord.py help server.
https://discord.gg/r3sSKJJ
Thank you so very much! @SourSpoon
Most helpful comment
client.kickdoes not take a user id as an argument but a member object.If you wanted to use method like this you would need to use the
server.get_member()method. Where server is the server object you wish to kick the user from.Questions like this are better suited to the discord.py help server.
https://discord.gg/r3sSKJJ