mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 00:31:00 -05:00
Fix MESSAGE_UPDATE raw event for message content being same
This commit is contained in:
parent
4cc1cfec52
commit
1210a84e55
@ -87,8 +87,11 @@ client.on('raw', async (packet:RawGatewayPacket<RawMessageUpdate>)=>{
|
|||||||
if (typeof packet.d.content === 'undefined') return;
|
if (typeof packet.d.content === 'undefined') return;
|
||||||
|
|
||||||
const channel = client.channels.cache.get(packet.d.channel_id) as Discord.TextBasedChannel;
|
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);
|
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>)=>{
|
client.on('raw', async (packet:RawGatewayPacket<RawMessageDelete>)=>{
|
||||||
|
Loading…
Reference in New Issue
Block a user