2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 10338
|
|
|
|
|
// Function ID: 10339
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useUserVoiceActivity
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [2045, 4469, 4855, 1085, 504, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: canViewUserVoiceChannel, default, getUserVoiceState
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 10338 (useUserVoiceActivity)
|
2026-10-01 14:13:23 +00:00
|
|
|
import Constants from "Constants" /* 1085 */;
|
|
|
|
|
import ChannelStore_mod from "ChannelStore" /* 2045 */;
|
|
|
|
|
import PermissionStore_mod from "PermissionStore" /* 4469 */;
|
|
|
|
|
import VoiceStateStore_mod from "VoiceStateStore" /* 4855 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
|
|
|
|
function getVisibleUserVoiceActivity(arg0, arg1) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guildId;
|
|
|
|
|
let includeNonDiscoverable;
|
|
|
|
|
let tmp4;
|
|
|
|
|
let userId;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
|
|
|
|
tmp = closure_6;
|
|
|
|
|
}
|
|
|
|
|
({ userId, guildId, includeNonDiscoverable } = arg0);
|
|
|
|
|
if (includeNonDiscoverable === undefined) {
|
|
|
|
|
includeNonDiscoverable = false;
|
|
|
|
|
}
|
|
|
|
|
let tmp3 = tmp;
|
|
|
|
|
if (tmp === undefined) {
|
|
|
|
|
tmp3 = closure_6;
|
|
|
|
|
}
|
|
|
|
|
if (null != guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channel;
|
|
|
|
|
let tmp12;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != userId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let voiceState;
|
2026-09-18 19:45:33 +00:00
|
|
|
const VoiceStateStore2 = tmp3.VoiceStateStore;
|
|
|
|
|
if (includeNonDiscoverable) {
|
2026-10-01 14:13:23 +00:00
|
|
|
voiceState = VoiceStateStore2.getVoiceState(guildId, userId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
voiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp4 = voiceState;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp7 = tmp;
|
|
|
|
|
if (tmp === undefined) {
|
|
|
|
|
tmp7 = closure_6;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
let channelId;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp4 != null) {
|
|
|
|
|
channelId = tmp4.channelId;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
ChannelStore = tmp7.ChannelStore;
|
|
|
|
|
channel = ChannelStore.getChannel(tmp4.channelId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp === undefined) {
|
2026-09-18 19:45:33 +00:00
|
|
|
tmp = closure_6;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp9 = null != tmp4;
|
|
|
|
|
if (tmp9) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let isPrivateResult;
|
|
|
|
|
if (channel != null) {
|
|
|
|
|
isPrivateResult = channel.isPrivate();
|
|
|
|
|
}
|
|
|
|
|
if (!isPrivateResult) {
|
|
|
|
|
PermissionStore = tmp.PermissionStore;
|
|
|
|
|
isPrivateResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp9 = isPrivateResult;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp9) {
|
|
|
|
|
tmp12 = { voiceState: tmp4, voiceChannel: channel };
|
|
|
|
|
const obj = { voiceState: tmp4, voiceChannel: channel };
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp12 = closure_7;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return tmp12;
|
|
|
|
|
}
|
|
|
|
|
if (null != userId) {
|
|
|
|
|
let voiceStateForUser;
|
2026-09-18 19:45:33 +00:00
|
|
|
VoiceStateStore = tmp3.VoiceStateStore;
|
|
|
|
|
if (includeNonDiscoverable) {
|
2026-10-01 14:13:23 +00:00
|
|
|
voiceStateForUser = VoiceStateStore.getVoiceStateForUser(userId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
voiceStateForUser = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp4 = voiceStateForUser;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let ChannelStore = ChannelStore_mod;
|
|
|
|
|
let PermissionStore = PermissionStore_mod;
|
|
|
|
|
let VoiceStateStore = VoiceStateStore_mod;
|
|
|
|
|
const Permissions = Constants.Permissions;
|
2026-09-18 19:45:33 +00:00
|
|
|
let closure_6 = { ChannelStore, PermissionStore, VoiceStateStore };
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_7 = Object.freeze({ voiceState: "Array", voiceChannel: "channel" });
|
2026-09-26 17:57:22 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/activity_status/useUserVoiceActivity.tsx");
|
|
|
|
|
|
|
|
|
|
export default function useUserVoiceActivity(userId) {
|
|
|
|
|
userId = userId.userId;
|
|
|
|
|
const guildId = userId.guildId;
|
|
|
|
|
const includeNonDiscoverable = userId.includeNonDiscoverable;
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = userId(guildId[4]);
|
2026-09-26 17:57:22 +00:00
|
|
|
const items = [includeNonDiscoverable, PermissionStore, VoiceStateStore];
|
|
|
|
|
const items1 = [guildId, userId, includeNonDiscoverable];
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj.useStateFromStoresObject(items, () => {
|
|
|
|
|
const obj = { userId, guildId, includeNonDiscoverable };
|
|
|
|
|
const obj2 = { ChannelStore, PermissionStore, VoiceStateStore };
|
|
|
|
|
return getVisibleUserVoiceActivity(obj, obj2);
|
|
|
|
|
}, items1);
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
|
|
|
|
export const getUserVoiceState = function getUserVoiceState(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guildId;
|
|
|
|
|
let includeNonDiscoverable;
|
|
|
|
|
let tmp2;
|
|
|
|
|
let userId;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ userId, guildId, includeNonDiscoverable } = arg0);
|
|
|
|
|
if (includeNonDiscoverable === undefined) {
|
|
|
|
|
includeNonDiscoverable = false;
|
|
|
|
|
}
|
|
|
|
|
let tmp = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
|
|
|
|
tmp = closure_6;
|
|
|
|
|
}
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
if (null != userId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let voiceState;
|
2026-09-18 19:45:33 +00:00
|
|
|
const VoiceStateStore2 = tmp.VoiceStateStore;
|
|
|
|
|
if (includeNonDiscoverable) {
|
2026-10-01 14:13:23 +00:00
|
|
|
voiceState = VoiceStateStore2.getVoiceState(guildId, userId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
voiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = voiceState;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return tmp2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != userId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let voiceStateForUser;
|
2026-09-18 19:45:33 +00:00
|
|
|
VoiceStateStore = tmp.VoiceStateStore;
|
|
|
|
|
if (includeNonDiscoverable) {
|
2026-10-01 14:13:23 +00:00
|
|
|
voiceStateForUser = VoiceStateStore.getVoiceStateForUser(userId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
voiceStateForUser = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = voiceStateForUser;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
2026-09-18 19:45:33 +00:00
|
|
|
export const canViewUserVoiceChannel = function canViewUserVoiceChannel(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guildId;
|
|
|
|
|
let includeNonDiscoverable;
|
|
|
|
|
let tmp4;
|
|
|
|
|
let userId;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
|
|
|
|
tmp = closure_6;
|
|
|
|
|
}
|
|
|
|
|
({ userId, guildId, includeNonDiscoverable } = arg0);
|
|
|
|
|
if (includeNonDiscoverable === undefined) {
|
|
|
|
|
includeNonDiscoverable = false;
|
|
|
|
|
}
|
|
|
|
|
let tmp3 = tmp;
|
|
|
|
|
if (tmp === undefined) {
|
|
|
|
|
tmp3 = closure_6;
|
|
|
|
|
}
|
|
|
|
|
if (null != guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channel;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != userId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let voiceState;
|
2026-09-18 19:45:33 +00:00
|
|
|
const VoiceStateStore2 = tmp3.VoiceStateStore;
|
|
|
|
|
if (includeNonDiscoverable) {
|
2026-10-01 14:13:23 +00:00
|
|
|
voiceState = VoiceStateStore2.getVoiceState(guildId, userId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
voiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp4 = voiceState;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp7 = tmp;
|
|
|
|
|
if (tmp === undefined) {
|
|
|
|
|
tmp7 = closure_6;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
let channelId;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp4 != null) {
|
|
|
|
|
channelId = tmp4.channelId;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
ChannelStore = tmp7.ChannelStore;
|
|
|
|
|
channel = ChannelStore.getChannel(tmp4.channelId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp === undefined) {
|
2026-09-18 19:45:33 +00:00
|
|
|
tmp = closure_6;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp9 = null != tmp4;
|
|
|
|
|
if (tmp9) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let isPrivateResult;
|
|
|
|
|
if (channel != null) {
|
|
|
|
|
isPrivateResult = channel.isPrivate();
|
|
|
|
|
}
|
|
|
|
|
if (!isPrivateResult) {
|
|
|
|
|
PermissionStore = tmp.PermissionStore;
|
|
|
|
|
isPrivateResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp9 = isPrivateResult;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return tmp9;
|
|
|
|
|
}
|
|
|
|
|
if (null != userId) {
|
|
|
|
|
let voiceStateForUser;
|
2026-09-18 19:45:33 +00:00
|
|
|
VoiceStateStore = tmp3.VoiceStateStore;
|
|
|
|
|
if (includeNonDiscoverable) {
|
2026-10-01 14:13:23 +00:00
|
|
|
voiceStateForUser = VoiceStateStore.getVoiceStateForUser(userId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
voiceStateForUser = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp4 = voiceStateForUser;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export { getVisibleUserVoiceActivity };
|