diff --git a/docker-compose.yml b/docker-compose.yml index ade263f..928a013 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: - HYPIXELAPIKEY=${HYPIXELAPIKEY} - REDISURI=${REDISURI} - POSTGRESURI=${POSTGRESURI} - depends_on: + depends_on: - db pull_policy: always db: diff --git a/src/events/server/voiceStateUpdate/updatecache.ts b/src/events/server/voiceStateUpdate/updatecache.ts new file mode 100644 index 0000000..39c0b46 --- /dev/null +++ b/src/events/server/voiceStateUpdate/updatecache.ts @@ -0,0 +1,18 @@ +import { VoiceState } from "discord.js" +import { IEvent } from "interfaces" + +export default { + name: "updatecache", + description: "Updates the voice states cache", + event: "voiceStateUpdate", + + async execute(_o: VoiceState, n: VoiceState) { + const guild = n.guild + + if (!guild) return + + if (!n.channel) { + guild.voiceStates.cache.delete(n.id) + } + } +} as IEvent