Skip to content

Commit e2ad150

Browse files
authored
fix(voiceOnDemand): remove duplicate channel deletion related code (#109)
1 parent 440fb14 commit e2ad150

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/modules/voiceOnDemand/voiceOnDemand.module.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,16 @@ export const voiceOnDemand = createModule({
8484
}
8585

8686
const lobbyIds = await cache.get('lobbyIds', []);
87-
const onDemandChannels = await cache.get('onDemandChannels', []);
88-
8987
const isLobbyChannel = lobbyIds.includes(channel.id);
90-
const isOnDemandChannel = onDemandChannels.includes(channel.id);
9188

92-
if (!isOnDemandChannel && !isLobbyChannel) {
89+
if (!isLobbyChannel) {
9390
return;
9491
}
9592

9693
await cache.set(
9794
'lobbyIds',
9895
lobbyIds.filter((lobbyId) => lobbyId !== channel.id),
9996
);
100-
101-
await Promise.all(
102-
onDemandChannels.map(async (id) => {
103-
const updatedChannel = await channel.guild.channels.fetch(id).catch(() => null);
104-
if (updatedChannel !== null) {
105-
await channel.guild.channels.delete(id);
106-
channel.guild.channels.cache.delete(id);
107-
}
108-
}),
109-
);
11097
},
11198
}),
11299
intents: ['GuildVoiceStates', 'GuildMembers'],

0 commit comments

Comments
 (0)