Skip to content Skip to sidebar Skip to footer

Discord Python Bot Not Sending Message

Please don't say 'Already answered', cause I tried EVERYTHING, including all related posts here and obviously, reading the api doc. Complete error is: Ignoring exception in on_read

Solution 1:

  1. Remove the quotes from:

channel = bot.get_channel('712559462262767617')

to

channel = bot.get_channel(712559462262767617)


  1. Change send_message to send

await channel.send(embed=embed)


Tell me if this works please. It seems as if you are using the older version of discord.py


I got this answer from: Trying to send a message to a specific channel using Discord.py rewrite and it isn't working

Solution 2:

This API Reference will probably be more useful: https://discordpy.readthedocs.io/en/latest/api.html#textchannel

You have to use send instead of send_message as defined in the documentation that I linked above

embed = discord.Embed(title="Hi!")

channel = bot.get_channel(712559462262767617)
await channel.send(embed=embed)

There a couple of changes you have to understand in the new version of discord.py For instance,

  • Snowflakes are no longer strings, they are integers now
  • send_message became send
  • Server is now Guild

Don't hesitate to check this link for a complete list of changes: https://discordpy.readthedocs.io/en/latest/migrating.html

Post a Comment for "Discord Python Bot Not Sending Message"