diff --git a/package.json b/package.json index 32611081..945e9e74 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "gradient-string": "^2.0.2", "ioredis": "^5.3.2", "kearsarge": "^1.0.3", - "pino": "^8.17.2", + "pino": "^8.18.0", "pino-pretty": "^10.3.1", "prometheus-middleware": "^1.3.3", "tslib": "^2.6.2", @@ -61,12 +61,12 @@ }, "devDependencies": { "@hazmi35/eslint-config": "^11.0.0", - "@swc/cli": "^0.3.5", + "@swc/cli": "^0.3.6", "@swc/core": "^1.3.107", "@types/amqplib": "^0.10.4", "@types/dockerode": "^3.3.23", "@types/gradient-string": "^1.1.5", - "@types/node": "^20.11.14", + "@types/node": "^20.11.16", "@typescript-eslint/eslint-plugin": "^6.18.1", "@typescript-eslint/parser": "^6.18.1", "@vladfrangu/async_event_emitter": "^2.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ded368c0..67d2cbbc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ dependencies: specifier: ^1.0.3 version: 1.0.3(bufferutil@4.0.8)(discord.js@14.14.1)(utf-8-validate@6.0.3) pino: - specifier: ^8.17.2 - version: 8.17.2 + specifier: ^8.18.0 + version: 8.18.0 pino-pretty: specifier: ^10.3.1 version: 10.3.1 @@ -94,8 +94,8 @@ devDependencies: specifier: ^11.0.0 version: 11.0.0(@eslint/js@8.56.0)(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@swc/cli': - specifier: ^0.3.5 - version: 0.3.5(@swc/core@1.3.107) + specifier: ^0.3.6 + version: 0.3.6(@swc/core@1.3.107) '@swc/core': specifier: ^1.3.107 version: 1.3.107 @@ -109,8 +109,8 @@ devDependencies: specifier: ^1.1.5 version: 1.1.5 '@types/node': - specifier: ^20.11.14 - version: 20.11.14 + specifier: ^20.11.16 + version: 20.11.16 '@typescript-eslint/eslint-plugin': specifier: ^6.18.1 version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) @@ -465,8 +465,8 @@ packages: engines: {node: '>=16.9.0', npm: '>=8.0.0'} dev: false - /@swc/cli@0.3.5(@swc/core@1.3.107): - resolution: {integrity: sha512-YWt6J7KrbGxvtuktFzsXibr0Npi/VhTdtA+rVkRty0A1KfQD18o2Tt9JMRlKTpH40ZMFygJf/Up6FxCFdFjV5g==} + /@swc/cli@0.3.6(@swc/core@1.3.107): + resolution: {integrity: sha512-ZoQbsJXjiWIlbCgr1m+m7TGNk7pILb3uWm4t423jM8vot8clseclXFU4QCMqJUVcYCSwKStzP3+yYMZvme/lsQ==} engines: {node: '>= 16.14.0'} hasBin: true peerDependencies: @@ -624,7 +624,7 @@ packages: /@types/amqplib@0.10.4: resolution: {integrity: sha512-Y5Sqquh/LqDxSgxYaAAFNM0M7GyONtSDCcFMJk+DQwYEjibPyW6y+Yu9H9omdkKc3epyXULmFN3GTaeBHhn2Hg==} dependencies: - '@types/node': 20.11.14 + '@types/node': 20.11.16 dev: true /@types/cacheable-request@6.0.3: @@ -633,13 +633,13 @@ packages: dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.11.14 + '@types/node': 20.11.16 '@types/responselike': 1.0.3 /@types/docker-modem@3.0.6: resolution: {integrity: sha512-yKpAGEuKRSS8wwx0joknWxsmLha78wNMe9R2S3UNsVOkZded8UqOrV8KoeDXoXsjndxwyF3eIhyClGbO1SEhEg==} dependencies: - '@types/node': 20.11.14 + '@types/node': 20.11.16 '@types/ssh2': 1.11.18 dev: true @@ -647,7 +647,7 @@ packages: resolution: {integrity: sha512-Lz5J+NFgZS4cEVhquwjIGH4oQwlVn2h7LXD3boitujBnzOE5o7s9H8hchEjoDK2SlRsJTogdKnQeiJgPPKLIEw==} dependencies: '@types/docker-modem': 3.0.6 - '@types/node': 20.11.14 + '@types/node': 20.11.16 dev: true /@types/gradient-string@1.1.5: @@ -668,7 +668,7 @@ packages: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} requiresBuild: true dependencies: - '@types/node': 20.11.14 + '@types/node': 20.11.16 /@types/node@18.19.4: resolution: {integrity: sha512-xNzlUhzoHotIsnFoXmJB+yWmBvFZgKCI9TtPIEdYIMM1KWfwuY8zh7wvc1u1OAXlC7dlf6mZVx/s+Y5KfFz19A==} @@ -676,8 +676,8 @@ packages: undici-types: 5.26.5 dev: true - /@types/node@20.11.14: - resolution: {integrity: sha512-w3yWCcwULefjP9DmDDsgUskrMoOy5Z8MiwKHr1FvqGPtx7CvJzQvxD7eKpxNtklQxLruxSXWddyeRtyud0RcXQ==} + /@types/node@20.11.16: + resolution: {integrity: sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==} dependencies: undici-types: 5.26.5 @@ -685,7 +685,7 @@ packages: resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} requiresBuild: true dependencies: - '@types/node': 20.11.14 + '@types/node': 20.11.16 /@types/semver@7.5.6: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} @@ -703,13 +703,13 @@ packages: /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.11.14 + '@types/node': 20.11.16 dev: false /@types/ws@8.5.9: resolution: {integrity: sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==} dependencies: - '@types/node': 20.11.14 + '@types/node': 20.11.16 dev: false /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3): @@ -2200,8 +2200,8 @@ packages: resolution: {integrity: sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==} dev: false - /pino@8.17.2: - resolution: {integrity: sha512-LA6qKgeDMLr2ux2y/YiUt47EfgQ+S9LznBWOJdN3q1dx2sv0ziDLUBeVpyVv17TEcGCBuWf0zNtg3M5m1NhhWQ==} + /pino@8.18.0: + resolution: {integrity: sha512-Mz/gKiRyuXu4HnpHgi1YWdHQCoWMufapzooisvFn78zl4dZciAxS+YeRkUxXl1ee/SzU80YCz1zpECCh4oC6Aw==} hasBin: true dependencies: atomic-sleep: 1.0.0 diff --git a/src/Listeners/Caches/Guilds/GuildCreateListener.ts b/src/Listeners/Caches/Guilds/GuildCreateListener.ts index 5c7b3d15..0bb888fa 100644 --- a/src/Listeners/Caches/Guilds/GuildCreateListener.ts +++ b/src/Listeners/Caches/Guilds/GuildCreateListener.ts @@ -30,28 +30,24 @@ export class GuildCreateListener extends Listener { } } await this.store.redis.incrby(GenKey(RedisKey.USER_KEY, RedisKey.COUNT), payload.data.d.members.length - alreadyExists); - payload.data.d.members = []; } if (stateChannels) { for (const channel of payload.data.d.channels) { await this.store.redis.set(GenKey(RedisKey.CHANNEL_KEY, channel.id, payload.data.d.id), JSON.stringify(channel)); } - payload.data.d.channels = []; } if (stateRoles) { for (const role of payload.data.d.roles) { await this.store.redis.set(GenKey(RedisKey.ROLE_KEY, role.id, payload.data.d.id), JSON.stringify(role)); } - payload.data.d.roles = []; } if (stateVoices) { for (const voice of payload.data.d.voice_states) { await this.store.redis.set(GenKey(RedisKey.VOICE_KEY, voice.user_id, payload.data.d.id), JSON.stringify(voice)); } - payload.data.d.voice_states = []; } if (stateEmojis) { @@ -60,19 +56,27 @@ export class GuildCreateListener extends Listener { await this.store.redis.set(GenKey(RedisKey.EMOJI_KEY, emoji.id, payload.data.d.id), JSON.stringify(emoji)); } } - payload.data.d.emojis = []; } if (statePresences) { for (const presence of payload.data.d.presences) { await this.store.redis.set(GenKey(RedisKey.PRESENCE_KEY, presence.user.id, payload.data.d.id), JSON.stringify(presence)); } - payload.data.d.presences = []; } const key = GenKey(RedisKey.GUILD_KEY, payload.data.d.id); const exists = await this.store.redis.exists(key); - await this.store.redis.set(key, JSON.stringify(payload.data.d)); + await this.store.redis.set(key, JSON.stringify({ + ...payload.data.d, + members: [], + voice_states: [], + emojis: [], + presences: [], + channels: [], + stickers: [], + soundboard_sounds: [], + threads: [] + })); if (exists === 0) await this.store.redis.incr(GenKey(RedisKey.GUILD_KEY, RedisKey.COUNT)); diff --git a/src/Listeners/Caches/Voices/VoiceStateUpdateListener.ts b/src/Listeners/Caches/Voices/VoiceStateUpdateListener.ts index d3123705..0b73cb39 100644 --- a/src/Listeners/Caches/Voices/VoiceStateUpdateListener.ts +++ b/src/Listeners/Caches/Voices/VoiceStateUpdateListener.ts @@ -18,7 +18,15 @@ export class VoiceStateUpdateListener extends Listener { if (stateVoices) { if (payload.data.d.channel_id) { const key = GenKey(RedisKey.VOICE_KEY, payload.data.d.user_id, payload.data.d.guild_id); - await this.store.redis.set(key, JSON.stringify(payload.data.d)); + await this.store.redis.set(key, JSON.stringify({ + ...payload.data.d, + member: payload.data.d.member + ? { + ...payload.data.d.member, + roles: [] + } + : null + })); await this.store.redis.sadd(GenKey(RedisKey.VOICE_KEY, RedisKey.LIST, payload.data.d.guild_id), key); } else { const key = GenKey(RedisKey.VOICE_KEY, payload.data.d.user_id, payload.data.d.guild_id);