Attributeerror: 'Client' Object Has No Attribute 'Send_Message' (Discord Bot)

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



Leave a reply



Submit