By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,854 Members | 849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,854 IT Pros & Developers. It's quick & easy.

Error 'list' object has no attribute 'mention' in python

P: 1
When i run my file, no problem, when I do the command, i get an error code that i dont know how to resovle, I have no list created.

Here is the error code :
`line 13, in on_message
if message.content.find (f"""!{member.mention} need love""") != -1:
AttributeError: 'list' object has no attribute 'mention'`


Here is code :


Expand|Select|Wrap|Line Numbers
  1.     @client.event
  2.     async def on_message(message):
  3.         id = client.get_guild(***)
  4.         channels = ["commands"]
  5.         member = message.mentions or message.author
  6.         if str(message.channel) in channels :
  7.             if message.content.find (f"""!{member.mention} need love""") != -1:
  8.                 await message.channel.send(f"""Oooooh {member.mention}, we love you, 
  9.                 you are beautiful, amazing, valid, and the {id.member_count} people
  10.                  on this server care about you. ♥♥♥♥♥""")
4 Weeks Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.