Skip to content

Commit

Permalink
surprise for dillon
Browse files Browse the repository at this point in the history
  • Loading branch information
BenPVandenberg committed Apr 28, 2023
1 parent 45aa137 commit e1d051d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions empire/events/voiceStateUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import assert from 'assert';
import Discord from 'discord.js';
import * as log from '../utilities/log';
import * as sql from '../utilities/sql';
import * as audio from '../utilities/audio';
import StreamManager from '../utilities/streamManager';
import path from 'path';

export default async function onVoiceStateUpdate(
oldMember: Discord.VoiceState,
Expand Down Expand Up @@ -39,6 +42,19 @@ export default async function onVoiceStateUpdate(
newMember.channel.name,
sessionID
);

try {
if (
newMember.channel instanceof Discord.VoiceChannel &&
newMember.id === '227596121126600704'
) {
const audioDir = audio.getAudioDir();
const filePath = path.join(audioDir, 'yo.mp3');
await StreamManager.playMP3(newMember.channel, filePath);
}
} catch (e) {
console.error(e);
}
} else if (
oldMember.channelId !== null &&
newMember.channelId !== null &&
Expand Down

0 comments on commit e1d051d

Please sign in to comment.