Skip to content

Commit

Permalink
fixed linting and type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Mike committed Mar 2, 2024
1 parent abe7eeb commit 195a619
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class implements Command {
.setDescription('whether to leave when everyone else leaves')
.setRequired(true)))
.addSubcommand(subcommand => subcommand
.setName('set-auto-announce-new-song')
.setName('set-auto-announce-next-song')
.setDescription('set whether to announce the next song in the queue automatically')
.addBooleanOption(option => option
.setName('value')
Expand Down
5 changes: 2 additions & 3 deletions src/services/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class {
public guildId: string;
public loopCurrentSong = false;
public loopCurrentQueue = false;
public currentChannel: VoiceChannel;
private currentChannel: VoiceChannel | undefined;
private queue: QueuedSong[] = [];
private queuePosition = 0;
private audioPlayer: AudioPlayer | null = null;
Expand Down Expand Up @@ -562,11 +562,10 @@ export default class {

if (newState.status === AudioPlayerStatus.Idle && this.status === STATUS.PLAYING) {
await this.forward(1);

// Auto announce the next song if configured to
const settings = await getGuildSettings(this.guildId);
const {autoAnnounceNextSong} = settings;
if (autoAnnounceNextSong) {
if (autoAnnounceNextSong && this.currentChannel) {
await this.currentChannel.send({
embeds: this.getCurrent() ? [buildPlayingMessageEmbed(this)] : [],
});
Expand Down

0 comments on commit 195a619

Please sign in to comment.