MemberCount: also show members in voice (#2937)
Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
parent
1d00ba4161
commit
b6e96a4d3b
10 changed files with 140 additions and 27 deletions
42
packages/discord-types/src/stores/VoiceStateStore.d.ts
vendored
Normal file
42
packages/discord-types/src/stores/VoiceStateStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { DiscordRecord } from "../common";
|
||||
import { FluxStore } from "./FluxStore";
|
||||
|
||||
export type UserVoiceStateRecords = Record<string, VoiceState>;
|
||||
export type VoiceStates = Record<string, UserVoiceStateRecords>;
|
||||
|
||||
export interface VoiceState extends DiscordRecord {
|
||||
userId: string;
|
||||
channelId: string | null | undefined;
|
||||
sessionId: string | null | undefined;
|
||||
mute: boolean;
|
||||
deaf: boolean;
|
||||
selfMute: boolean;
|
||||
selfDeaf: boolean;
|
||||
selfVideo: boolean;
|
||||
selfStream: boolean | undefined;
|
||||
suppress: boolean;
|
||||
requestToSpeakTimestamp: string | null | undefined;
|
||||
discoverable: boolean;
|
||||
|
||||
isVoiceMuted(): boolean;
|
||||
isVoiceDeafened(): boolean;
|
||||
}
|
||||
|
||||
export class VoiceStateStore extends FluxStore {
|
||||
getAllVoiceStates(): VoiceStates;
|
||||
|
||||
getVoiceStates(guildId?: string | null): UserVoiceStateRecords;
|
||||
getVoiceStatesForChannel(channelId: string): UserVoiceStateRecords;
|
||||
getVideoVoiceStatesForChannel(channelId: string): UserVoiceStateRecords;
|
||||
|
||||
getVoiceState(guildId: string | null, userId: string): VoiceState | undefined;
|
||||
getUserVoiceChannelId(guildId: string | null, userId: string): string | undefined;
|
||||
getVoiceStateForChannel(channelId: string, userId?: string): VoiceState | undefined;
|
||||
getVoiceStateForUser(userId: string): VoiceState | undefined;
|
||||
|
||||
getCurrentClientVoiceChannelId(guildId: string | null): string | undefined;
|
||||
isCurrentClientInVoiceChannel(): boolean;
|
||||
|
||||
isInChannel(channelId: string, userId?: string): boolean;
|
||||
hasVideo(channelId: string): boolean;
|
||||
}
|
||||
1
packages/discord-types/src/stores/index.d.ts
vendored
1
packages/discord-types/src/stores/index.d.ts
vendored
|
|
@ -16,6 +16,7 @@ export * from "./ThemeStore";
|
|||
export * from "./TypingStore";
|
||||
export * from "./UserProfileStore";
|
||||
export * from "./UserStore";
|
||||
export * from "./VoiceStateStore";
|
||||
export * from "./WindowStore";
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue