Discord Python Bot Not Sending Message
Solution 1:
- Remove the quotes from:
channel = bot.get_channel('712559462262767617')
to
channel = bot.get_channel(712559462262767617)
- Change
send_message
tosend
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
becamesend
- 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"