Fixes to music functions and commands

pull/70/head
Trivernis 5 years ago
parent d65616eadc
commit 86f3ef8c13

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- bug on `AnilistApiCommands` where the `RichCharacterInfo` uses a nonexistent function of the `ExtendedRichEmbed` - bug on `AnilistApiCommands` where the `RichCharacterInfo` uses a nonexistent function of the `ExtendedRichEmbed`
- bug on`AnilistApi` where the `.gql` files couldn't be found. - bug on`AnilistApi` where the `.gql` files couldn't be found.
- Typo in changelog - Typo in changelog
- bug on `~np` message that causes the player to crash
### Changed ### Changed
- name of MiscCommands module from `TemplateCommandModule` to `MiscCommandModule` - name of MiscCommands module from `TemplateCommandModule` to `MiscCommandModule`
@ -33,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- table `messages` to main database where messages are stored for statistical analysis and bug handling - table `messages` to main database where messages are stored for statistical analysis and bug handling
- ExtendedEventEmitter class in lib/utils/extended-events.js - ExtendedEventEmitter class in lib/utils/extended-events.js
- Response object that allows the registration of events for messages - Response object that allows the registration of events for messages
- Handling of error event for every VoiceConnection
### Removed ### Removed
- `~volume` command because volume can't be controlled anymore - `~volume` command because volume can't be controlled anymore

@ -239,7 +239,7 @@ class MusicCommandModule extends cmdLib.CommandModule {
.setImage(utils.YouTube.getVideoThumbnailUrlFromUrl(song.url)) .setImage(utils.YouTube.getVideoThumbnailUrlFromUrl(song.url))
.setColor(0x00aaff)); .setColor(0x00aaff));
if (message.id !== message.channel.lastMessageID) { if (message.id !== message.channel.lastMessageID) {
gh.musicPlayer.off('next', next); gh.musicPlayer.removeListener('next', next);
message.delete(); message.delete();
} }
}; };

@ -49,6 +49,11 @@ class MusicPlayer extends xevents.ExtendedEventEmitter {
this.voiceChannel = voiceChannel; this.voiceChannel = voiceChannel;
this._logger.verbose(`Connecting to voiceChannel ${this.voiceChannel.name}`); this._logger.verbose(`Connecting to voiceChannel ${this.voiceChannel.name}`);
let connection = await this.voiceChannel.join(); let connection = await this.voiceChannel.join();
connection.on('error', (err) => {
this._logger.error(err.message);
this._logger.debug(err.stack);
});
this._logger.info(`Connected to Voicechannel ${this.voiceChannel.name}`); this._logger.info(`Connected to Voicechannel ${this.voiceChannel.name}`);
this.conn = connection; this.conn = connection;
this.emit('connected'); this.emit('connected');

@ -71,7 +71,7 @@ head
span#mp-queueCount span#mp-queueCount
| Songs in Queue | Songs in Queue
span.cell span.cell
| Next | Next
span#mp-queueDisplayCount 0 span#mp-queueDisplayCount 0
| Songs: | Songs:
#mp-songQueue #mp-songQueue

Loading…
Cancel
Save