dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
680 stars 162 forks source link

Bad Request Empty Message #194

Closed FuckingToasters closed 2 years ago

FuckingToasters commented 2 years ago

Summary

Sending a Embed to Discord

Reproduction Steps

I created a code that should send an embed but i get an error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message The Embed is not empty and has a title, a description, fields, footer & more

Code

@commands.command(name='claimnitro')
    async def claimnitro(self, ctx):
        await ctx.message.delete()
        first_embed = selfcord.Embed(title="Nitro Generator", description="Please wait until the generated gift is available!", color=0x00ff00)
        first_embed.set_thumbnail(url=ctx.author.avatar_url)
        first_embed.set_image(url="https://cdn.discordapp.com/attachments/903339334177022007/934510840697208962/free-nitro.gif")
        first_embed.add_field(name="Status", value="Claiming Nitro...", inline=False)
        first_embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)

        second_embed = selfcord.Embed(title="1 Month Discord Nitro Code:", description="", color=0x00ff00)
        second_embed.set_thumbnail(url=ctx.author.avatar_url)
        second_embed.set_image(url="https://cdn.discordapp.com/attachments/903339334177022007/934510840697208962/free-nitro.gif")
        second_embed.add_field(name="Status", value="Claimed an Code!", inline=False)
        second_embed.add_field(name="Gift Code", value="[Click me to redeem the Gift](https://www.youtube.com/watch?v=a3Z7zEc7AXQ)", inline=False)
        second_embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
        first_message = await ctx.send(embed=first_embed)
        second_message = await ctx.send(embed=second_embed)
        await first_message.edit(second_message)

Expected Results

I expected it to send it without any error.

Actual Results

The Error above happen

System Information

Checklist

Additional Information

No response

dolfies commented 2 years ago

Discord patched embed sending. See #193.