Discord.py: "Bad Request" error when sending rich embeds

Created on 28 Dec 2016  路  2Comments  路  Source: Rapptz/discord.py

I'm not sure which fields are supposed to be filled out, but this is giving me an error whenever run.

import discord
import asyncio

testEmbed = discord.Embed(title='test', type='rich', description='test', url='xxx', colour = discord.Colour.blue())
testEmbed.set_thumbnail(url='xxx')
testEmbed.set_author(name='test')
testEmbed.set_footer(text='test')

client = discord.Client()

@client.event
async def on_message(message):
        if message.content.startswith('!test'):
                await client.send_message(message.channel, embed=testEmbed)

client.run('xxx')

Most helpful comment

"rich" is the default type of embed, and the only one users and bots may send, so there's no need to specify type='rich'.
Aside from that, url must be in URL format, meaning it must start with "http(s)://".

All 2 comments

"rich" is the default type of embed, and the only one users and bots may send, so there's no need to specify type='rich'.
Aside from that, url must be in URL format, meaning it must start with "http(s)://".

Thanks, it worked!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

j0hnmeow picture j0hnmeow  路  3Comments

Spyder-exe picture Spyder-exe  路  3Comments

reuscam picture reuscam  路  3Comments

Rimmy50 picture Rimmy50  路  3Comments

tairabiteru picture tairabiteru  路  3Comments