Voice Disconnect refactor to use new builtin base

This commit is contained in:
Jiiks 2018-08-25 16:59:24 +03:00
parent 937ab55456
commit e798e3d6e2
1 changed files with 10 additions and 8 deletions

View File

@ -13,21 +13,23 @@ import { Reflection } from 'modules';
export default new class VoiceDisconnect extends BuiltinModule {
get settingPath() {
return ['core', 'default', 'voice-disconnect'];
}
/* Getters */
get moduleName() { return 'VoiceDisconnect' }
get settingPath() { return ['core', 'default', 'voice-disconnect'] }
async enabled(e) {
window.addEventListener('beforeunload', this.listener);
}
listener() {
const { VoiceChannelActions } = Reflection.modules;
VoiceChannelActions.selectVoiceChannel(null, null);
}
disabled(e) {
window.removeEventListener('beforeunload', this.listener);
}
/* Methods */
listener() {
const { VoiceChannelActions } = Reflection.modules;
VoiceChannelActions.selectVoiceChannel(null, null);
}
}