Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
feat: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
  • Loading branch information
amishshah and kyranet authored Jun 8, 2021
1 parent 9ab76f7 commit bb2854f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/music-bot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ client.on('interaction', async (interaction: Interaction) => {
// Attempt to create a Track from the user's video URL
const track = await Track.from(url, {
onStart() {
interaction.followUp(`Now playing!`, { ephemeral: true }).catch(console.warn);
interaction.followUp('Now playing!', { ephemeral: true }).catch(console.warn);
},
onFinish() {
interaction.followUp(`Now finished!`, { ephemeral: true }).catch(console.warn);
interaction.followUp('Now finished!', { ephemeral: true }).catch(console.warn);
},
onError(error) {
console.warn(error);
Expand Down
4 changes: 2 additions & 2 deletions examples/music-bot/src/music/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class MusicSubscription {
if (this.voiceConnection.state.status === VoiceConnectionStatus.Disconnected) {
this.voiceConnection.reconnect();
}
}, (this.voiceConnection.reconnectAttempts + 1) * 5e3).unref();
}, (this.voiceConnection.reconnectAttempts + 1) * 5_000).unref();
} else {
this.voiceConnection.destroy();
}
Expand All @@ -47,7 +47,7 @@ export class MusicSubscription {
) {
// In the Signalling or Connecting states, set a time limit to prevent starvation
// These states can be entered after Ready in an automatic reconnect, e.g. unknown close code, UDP keep-alive failed
this.connectPromise = entersState(this.voiceConnection, VoiceConnectionStatus.Ready, 20e3)
this.connectPromise = entersState(this.voiceConnection, VoiceConnectionStatus.Ready, 20_000)
.then(() => undefined)
.catch(() => {
if (this.voiceConnection.state.status !== VoiceConnectionStatus.Destroyed) this.voiceConnection.destroy();
Expand Down

0 comments on commit bb2854f

Please sign in to comment.