Skip to content

Commit

Permalink
Add logging (#117)
Browse files Browse the repository at this point in the history
Co-authored-by: Ed Morgan <[email protected]>
  • Loading branch information
ebm5025 and Ed Morgan authored Jun 22, 2024
1 parent d50d61e commit c5f0e1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/features/wakeup/wakeup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ export class WakeupService implements IWakeupService {
});
const player = createAudioPlayer();

player.on("error", (error) => {
console.error(`Error: ${error.message}`);
});

// Play wakeup song
let songUrl = await redisClient.hGet("wakeup", "song");
if (!songUrl) {
songUrl = "media/daddychill.mp3";
}

console.log(`Wakeup song url ${songUrl}`);

let audio: string | internal.Readable | undefined = undefined;
if (songUrl.includes("youtu")) {
audio = ytdl(songUrl, {
Expand Down
5 changes: 0 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ client.on("guildScheduledEventCreate", guildScheduledEventListener);
client.on("guildScheduledEventDelete", guildScheduledEventListener);
client.on("guildScheduledEventUpdate", guildScheduledEventListener);
client.on("guildScheduledEventUpdate", guildScheduledEventStartedListener);
client.on("voiceStateUpdate", (oldState: VoiceState, newState: VoiceState) => {
console.log(
`Voice state changed: ${oldState.toJSON()} to ${newState.toJSON()}`
);
});

registerSlashCommands();

Expand Down

0 comments on commit c5f0e1e

Please sign in to comment.