Skip to content

Commit

Permalink
Deleting Now Playing message
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptiklemur committed Feb 15, 2016
1 parent 50d659e commit 9eca468
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Helper/PlaybackHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,16 @@ class PlaybackHelper {
this.seekVal = seek > 0 ? seek : false;

let user = this.client.users.get('id', song.user);
this.client.sendMessage(this.channel, `Now playing **${song.name}**. Requested by **${user.name}**`);

let playMessage;
this.client.sendMessage(
this.channel,
`Now playing **${song.name}**. Requested by **${user.name}**`,
(error, message) => {
playMessage = message;
}
);

this.client.setStatus('online', song.name);
this.logger.info("Playing " + song.name + ' - ' + filename);

Expand All @@ -268,6 +277,7 @@ class PlaybackHelper {
}

this.stream.on('end', this.nextInQueue);
this.stream.on('end', () => this.client.deleteMessage(playMessage));

callback();
});
Expand Down

0 comments on commit 9eca468

Please sign in to comment.