Update RemoveBlockedUsers.plugin.js
This commit is contained in:
parent
30f3e0e4cb
commit
38d9afe7e7
|
@ -2,7 +2,7 @@
|
||||||
* @name RemoveBlockedUsers
|
* @name RemoveBlockedUsers
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.6.0
|
* @version 1.6.1
|
||||||
* @description Removes blocked Messages/Users
|
* @description Removes blocked Messages/Users
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -166,13 +166,13 @@ module.exports = (_ => {
|
||||||
|
|
||||||
let muteTimeout;
|
let muteTimeout;
|
||||||
let channelId = BDFDB.LibraryModules.RTCConnectionUtils.getChannelId();
|
let channelId = BDFDB.LibraryModules.RTCConnectionUtils.getChannelId();
|
||||||
let connectedUsers = BDFDB.ObjectUtils.filter(BDFDB.LibraryStores.SortedVoiceStateStore.getVoiceStates(BDFDB.LibraryModules.RTCConnectionUtils.getGuildId()), n => n && n.channelId == channelId && !BDFDB.LibraryStores.RelationshipStore.isBlocked(n.userId));
|
let connectedUsers = BDFDB.ObjectUtils.filter(BDFDB.LibraryStores.SortedVoiceStateStore.getVoiceStates(BDFDB.LibraryModules.RTCConnectionUtils.getGuildId()), n => n && n.voiceState && n.voiceState.channelId == channelId && !BDFDB.LibraryStores.RelationshipStore.isBlocked(n.voiceState.userId));
|
||||||
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "playSound", {before: e => {
|
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "playSound", {before: e => {
|
||||||
let type = e.methodArguments[0];
|
let type = e.methodArguments[0];
|
||||||
if (!this.settings.notifications.voiceChat || !["disconnect", "user_join", "user_leave", "user_moved"].includes(type)) return;
|
if (!this.settings.notifications.voiceChat || !["disconnect", "user_join", "user_leave", "user_moved"].includes(type)) return;
|
||||||
channelId = BDFDB.LibraryModules.RTCConnectionUtils.getChannelId();
|
channelId = BDFDB.LibraryModules.RTCConnectionUtils.getChannelId();
|
||||||
if (channelId) {
|
if (channelId) {
|
||||||
let allConnectedUsers = BDFDB.ObjectUtils.filter(BDFDB.LibraryStores.SortedVoiceStateStore.getVoiceStates(BDFDB.LibraryModules.RTCConnectionUtils.getGuildId()), n => n && n.channelId == channelId);
|
let allConnectedUsers = BDFDB.ObjectUtils.filter(BDFDB.LibraryStores.SortedVoiceStateStore.getVoiceStates(BDFDB.LibraryModules.RTCConnectionUtils.getGuildId()), n => n && n.voiceState && n.voiceState.channelId == channelId);
|
||||||
let unblockedUsers = BDFDB.ObjectUtils.filter(allConnectedUsers, n => n && !BDFDB.LibraryStores.RelationshipStore.isBlocked(n.userId));
|
let unblockedUsers = BDFDB.ObjectUtils.filter(allConnectedUsers, n => n && !BDFDB.LibraryStores.RelationshipStore.isBlocked(n.userId));
|
||||||
let unmutedBlockedUsers = BDFDB.ObjectUtils.toArray(allConnectedUsers).filter(n => n && BDFDB.LibraryStores.RelationshipStore.isBlocked(n.userId) && !BDFDB.LibraryStores.MediaEngineStore.isLocalMute(n.userId));
|
let unmutedBlockedUsers = BDFDB.ObjectUtils.toArray(allConnectedUsers).filter(n => n && BDFDB.LibraryStores.RelationshipStore.isBlocked(n.userId) && !BDFDB.LibraryStores.MediaEngineStore.isLocalMute(n.userId));
|
||||||
if (unmutedBlockedUsers.length) {
|
if (unmutedBlockedUsers.length) {
|
||||||
|
|
Loading…
Reference in New Issue