473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.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. ♥♥♥♥♥""")
Nov 17 '19 #1
0 1925

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

Similar topics

4
by: python newbie | last post by:
Is there anything that would get in the way of me being able to reference an object attribute, from within a list. I have: # one class here class BackupSet: fileGroupList = # ...
0
by: Vikram | last post by:
hi, i have a program which uses multiple threads and downloads pages using pycurl and processes these pages among other things. the program works fine with python 2.2 and pycurl 7.10.8 ; with...
1
by: Egil M?ller | last post by:
I'm developing a larger Python program, and one component (a text parser for a networking protocol) happend to be terribly slow, while quite a simple piece of code, so I decided to reimplement it...
3
by: ADavidson | last post by:
I'm getting a {"Parser Error: The Runat attribute must have the value Server." } error when I try to get the Server.GetlastError() in the Global.asax codebehind. Why am I getting this? I...
3
by: Huayang Xia | last post by:
I get a python object by running a class' constructor. Then I need to modify the instance's attribute just like obj.attr1.attr2 = 'a' if in python's term. PyObject* py_obj_attr1 =...
2
by: Steve Potter | last post by:
I am trying to find some method of attaching a Listbox object to a list object so as the contents of the list are changed the contents of the Listbox will be updated to match. I have found a few...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
1
by: p.lavarre | last post by:
Is this interesting Python output? $ gc-object-already-tracked.py ********************************************************************** File...
3
by: Gandalf | last post by:
my manual contain chapter about lists with python. when i try to copy paste : li = (1) it i get this errore: "TypeError: 'list' object is not callable"
0
by: jadeite100 | last post by:
Hi: In the UT web site it says we're suppose to use Python 2.52: http://www.cdf.utoronto.ca/~csc148h/winter/python.shtml I am currently using Windows XP SP3 in my laptop. When I ran the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.