Discord Movie Bot error - AttributeError: 'Client' object has no attribute 'send_message'
Consider looking at the documentation for discord.py https://discordpy.readthedocs.io/en/stable/api.html?highlight=client#discord.Client
The discord.Client class does not have a method called send_message. As mentioned in the link you posted, you can use message.channel.send("Content")
to send a message.
Hope this helps :D
Client' object has no attribute 'send_message' error
Client.send_message()
is a very outdated method and has been removed in the latest versions of discord.py. Use Member.send()
to send DM messages:
@client.event
async def on_member_join(member):
await member.send('Welcome to the server!')
Also note that when a member leaves the server and the bot has no common guilds with that user, your bot will be unable to DM them and will throw a discord.Forbidden
exception.
discord.py bot rewrite AttributeError: 'Bot' object has no attribute 'send_message'
You've installed the rewrite branch of discord.py
that does sending messages in a different way
# before
await client.send_message(channel, 'Hello')
# after
await channel.send('Hello')
Related Topics
Unbalanced Data and Weighted Cross Entropy
How to Flatten a List of Lists/Nested Lists
String Similarity Metrics in Python
Sorting a Dictionary with Lists as Values, According to an Element from the List
How to Remove Leading Whitespace in Python
Adding Headers to Requests Module
Permanently Adding a File Path to Sys.Path in Python
How to Handle an Asymptote/Discontinuity with Matplotlib
Login to Website Using Urllib2 - Python 2.7
Why Does CSVwriter.Writerow() Put a Comma After Each Character
Is There a Difference Between Using a Dict Literal and a Dict Constructor
Matplotlib - Extracting Data from Contour Lines
How to Get the Domain Name of My Site Within a Django Template
Pyplot Move Alternative Y Axis to Background
What Is the Meaning of "Failed Building Wheel for X" in Pip Install
Checking Odd/Even Numbers and Changing Outputs on Number Size
How to Initialize the Base (Super) Class
Sort Multidimensional Array Based on 2Nd Element of the Subarray