mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-27 04:15:38 -05:00
Fix MESSAGE_UPDATE raw event for message content being same
This commit is contained in:
parent
6c6c7435da
commit
cdd65f1969
@ -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>)=>{
|
||||
|
Loading…
Reference in New Issue
Block a user