feat: some random moving system

This commit is contained in:
2023-02-21 21:16:02 +01:00
parent 3f18ff0bbb
commit f9eedaff9e
2 changed files with 7 additions and 2 deletions

View File

@@ -1,10 +1,14 @@
import { EventType, eventModule } from "@sern/handler";
import { VoiceState } from "discord.js";
import { VoiceChannel, VoiceState } from "discord.js";
export default eventModule({
type: EventType.Discord,
name: 'voiceStateUpdate',
execute: async (oldState: VoiceState, newState: VoiceState) => {
if (newState.member!.id !== '954042602615869520') return;
if (newState.member!.id !== '703974042700611634') return;
if (newState.channelId === '940619088550559745' && (await newState.client.channels.fetch('839200013618774028') as VoiceChannel).members.size >= 1) {
await newState.member?.voice.setChannel('839200013618774028')
}
},
});

View File

@@ -9,6 +9,7 @@ const client = new Client({
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildVoiceStates,
],
});