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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NightStar
    New Member
    • Nov 2019
    • 1

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

    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.m ention} need love""") != -1:
    AttributeError: 'list' object has no attribute 'mention'`


    Here is code :


    Code:
        @client.event
        async def on_message(message):
            id = client.get_guild(***)
            channels = ["commands"]
            member = message.mentions or message.author
            if str(message.channel) in channels :
                if message.content.find (f"""!{member.mention} need love""") != -1:
                    await message.channel.send(f"""Oooooh {member.mention}, we love you, 
                    you are beautiful, amazing, valid, and the {id.member_count} people
                     on this server care about you. ♥♥♥♥♥""")
    Last edited by gits; Nov 18 '19, 08:21 AM. Reason: added code tags
Working...