1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-28 08:55:38 -05:00

Add ability to disable raw gateway events

This commit is contained in:
toast-ts 2024-01-23 09:15:40 +11:00
parent 0e70dbb396
commit 14df879b6e

View File

@ -76,6 +76,10 @@ export let rawSwitches = {
MESSAGE_UPDATE: false, MESSAGE_UPDATE: false,
MESSAGE_DELETE: false MESSAGE_DELETE: false
}; };
if (!client.config.botSwitches.logs) {
rawSwitches.MESSAGE_DELETE = true;
rawSwitches.MESSAGE_UPDATE = true;
};
client.on('raw', async (packet:RawGatewayPacket<RawMessageUpdate>)=>{ client.on('raw', async (packet:RawGatewayPacket<RawMessageUpdate>)=>{
if (rawSwitches[packet.t]) return; if (rawSwitches[packet.t]) return;
if (packet.t !== 'MESSAGE_UPDATE') return; if (packet.t !== 'MESSAGE_UPDATE') return;