Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Guild.voiceStates To Typings And JSDocs #3294

Merged
merged 4 commits into from Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/stores/VoiceStateStore.js
Expand Up @@ -3,6 +3,10 @@
const DataStore = require('./DataStore');
const VoiceState = require('../structures/VoiceState');

/**
* Stores voice states.
* @extends {DataStore}
*/
class VoiceStateStore extends DataStore {
constructor(guild, iterable) {
super(guild.client, iterable, VoiceState);
Expand Down
4 changes: 4 additions & 0 deletions src/structures/Guild.js
Expand Up @@ -57,6 +57,10 @@ class Guild extends Base {
*/
this.presences = new PresenceStore(this.client);

/**
* A collection of voice states in this guild
* @type {VoiceStateStore<Snowflake, VoiceState>}
*/
this.voiceStates = new VoiceStateStore(this);

/**
Expand Down
5 changes: 5 additions & 0 deletions typings/index.d.ts
Expand Up @@ -439,6 +439,7 @@ declare module 'discord.js' {
public verificationLevel: number;
public readonly verified: boolean;
public readonly voice: VoiceState | null;
public readonly voiceStates: VoiceStateStore;
public readonly widgetChannel: TextChannel | null;
public widgetChannelID: Snowflake | null;
public widgetEnabled: boolean | null;
Expand Down Expand Up @@ -1508,6 +1509,10 @@ declare module 'discord.js' {
public fetch(id: Snowflake, cache?: boolean): Promise<User>;
}

export class VoiceStateStore extends DataStore<Snowflake, VoiceState, typeof VoiceState> {
constructor(guild: Guild, iterable?: Iterable<any>);
}

//#endregion

//#region Mixins
Expand Down