Skip to content

Sending message with embed triggers on_message_edit #2476

@slysherz

Description

@slysherz

Summary

When the bot sends a message with an embed, it triggers on_message_edit.
If the message with the embed is sent by a user instead, it works correctly and on_message_edit doesn't trigger.

Reproduction Steps

1 - Run the bot

import discord

token = "???"
client = discord.Client()

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    embed = discord.Embed()

    await message.channel.send(embed=embed)

@client.event
async def on_message_edit(before, after):
    print("message update!")

@client.event
async def on_ready():
    print("ready")

client.run(token)

2 - Send any message to the bot

Expected Results

on_message_edit should not trigger and message update! should not be printed.

Actual Results

ready
message update!

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

Windows:

  • Python v3.8.0-final
  • discord.py v1.2.5-final
  • aiohttp v3.5.4
  • websockets v6.0
  • system info: Windows 10 10.0.18362

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThis is a question about the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions