Search code examples
pythonapidiscorddiscord.pybots

How to remove a specific link preview (auto-embed) in a specific message with Discord.py bot?


I have a problem with my python bot discord.py. I need to remove the Twitter previews in some posts and I can't find a way to remove the link preview like in the discord client.

Right now I'm deleting the entire post and posting a new one writing who the original poster is followed by the link without its preview but it's messy.

Thanks.


Solution

  • Thanks to TheFungusAmongUs answer to an other post, we only need to use message.edit(suppress=True) on a message to suppress its visual embeddings:

        @commands.command()
        async def some_command(self,ctx,*args):
            await ctx.message.edit(suppress=True)