1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10: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 6c6c7435da
commit cdd65f1969

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>)=>{