1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 20:30:58 -05:00

Fix MESSAGE_UPDATE raw event for message content being same

This commit is contained in:
toast-ts 2024-01-27 04:33:59 +11:00
parent 4cc1cfec52
commit 1210a84e55

View File

@ -87,8 +87,11 @@ client.on('raw', async (packet:RawGatewayPacket<RawMessageUpdate>)=>{
if (typeof packet.d.content === 'undefined') return;
const channel = client.channels.cache.get(packet.d.channel_id) as Discord.TextBasedChannel;
const old_message = await channel.messages.fetch(packet.d.id);
const new_message = await channel.messages.fetch(packet.d.id);
client.emit('messageUpdate', new_message, new_message);
if (old_message.content === new_message.content) return;
client.emit('messageUpdate', old_message, new_message);
});
client.on('raw', async (packet:RawGatewayPacket<RawMessageDelete>)=>{