Summary
In Pycord 2.7, payload.cached_message is None even when the message is cached, proven by the fact that on_message_edit() fires — this does not happen in 2.6.1.
Reproduction Steps
- Send a message
- Start the bot
- Edit the message twice
Observed Behavior (2.7)
First edit
on_raw_message_edit() fires
payload.cached_message is None
on_message_edit() does not fire
✔ expected
Second edit
on_raw_message_edit() fires
on_message_edit() fires
payload.cached_message is still None
⚠️ The message is clearly cached (since on_message_edit() fired), but payload.cached_message incorrectly reports None.
Newly Sent Messages (bot already running)
- Send a new message
- Edit it
Result in 2.7:
on_message_edit() fires
payload.cached_message is None
So,
- Message is cached
- Raw payload says it is not
Same Steps in 2.6.1 (correct behavior)
Minimal Reproducible Code
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(
command_prefix="!",
intents=intents,
)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user} (ID: {bot.user.id})")
# Fires ONLY if message is cached
@bot.event
async def on_message_edit(before, after):
print("=== CACHED MESSAGE EDIT ===")
print(f"Message ID: {after.id}")
print()
# Fires ALWAYS (cached or not)
@bot.event
async def on_raw_message_edit(payload: discord.RawMessageUpdateEvent):
print("=== RAW MESSAGE EDIT ===")
print(f"Message ID : {payload.message_id}")
print(f"Cached? : {payload.cached_message is not None}")
print()
bot.run("TOKEN")
Expected Results
on_message_edit() fires <=> payload.cached_message is not None
✔ true in 2.6.1
❌ false in 2.7
Actual Results
on_message_edit() fires, but payload.cached_message is None in on_raw_message_edit()
Intents
intents.message_content = True
System Information
- Python v3.13.5-final
- py-cord v2.7.None-final
- aiohttp v3.13.2
- system info: Windows 11 10.0.22631
Checklist
Additional Context
No response
Summary
In Pycord 2.7,
payload.cached_messageisNoneeven when the message is cached, proven by the fact thaton_message_edit()fires — this does not happen in 2.6.1.Reproduction Steps
Observed Behavior (2.7)
First edit
on_raw_message_edit()firespayload.cached_messageisNoneon_message_edit()does not fire✔ expected
Second edit
on_raw_message_edit()fireson_message_edit()firespayload.cached_messageis stillNoneon_message_edit()fired), butpayload.cached_messageincorrectly reportsNone.Newly Sent Messages (bot already running)
Result in 2.7:
on_message_edit()firespayload.cached_messageisNoneSo,
Same Steps in 2.6.1 (correct behavior)
If
on_message_edit()fires:payload.cached_messageis populatedNo contradictions between raw and non-raw events
Minimal Reproducible Code
Expected Results
✔ true in 2.6.1
❌ false in 2.7
Actual Results
on_message_edit() fires, but payload.cached_message is None in on_raw_message_edit()
Intents
intents.message_content = True
System Information
Checklist
Additional Context
No response