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

fix voice channel leave docs/typings #590

Merged
merged 6 commits into from Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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: 2 additions & 2 deletions index.d.ts
Expand Up @@ -724,7 +724,7 @@ declare namespace Eris {
listener: (user: User, oldUser: { username: string; discriminator: string; avatar?: string }) => void
): T;
(event: "voiceChannelJoin", listener: (member: Member, newChannel: VoiceChannel) => void): T;
(event: "voiceChannelLeave", listener: (member: Member, oldChannel: VoiceChannel) => void): T;
(event: "voiceChannelLeave", listener: (member: Member | null, oldChannel: VoiceChannel) => void): T;
(
event: "voiceChannelSwitch",
listener: (member: Member, newChannel: VoiceChannel, oldChannel: VoiceChannel) => void
Expand Down Expand Up @@ -1125,7 +1125,7 @@ declare namespace Eris {
limit?: number;
constructor(baseObject: new (...args: any[]) => T, limit?: number);
add(obj: T, extra?: any, replace?: boolean): T;
find(func: (i: T) => boolean): T;
find(func: (i: T) => boolean): T | undefined;
random(): T;
filter(func: (i: T) => boolean): T[];
map<R>(func: (i: T) => R): R[];
Expand Down
10 changes: 5 additions & 5 deletions lib/gateway/Shard.js
Expand Up @@ -370,8 +370,8 @@ class Shard extends EventEmitter {
* Fired when a guild member switches voice channels
* @event Client#voiceChannelSwitch
* @prop {Member} member The member
* @prop {CategoryChannel | TextChannel | VoiceChannel} newChannel The new voice channel
* @prop {CategoryChannel | TextChannel | VoiceChannel} oldChannel The old voice channel
* @prop {VoiceChannel} newChannel The new voice channel
* @prop {VoiceChannel} oldChannel The old voice channel
*/
oldChannel.voiceMembers.remove(member);
this.emit("voiceChannelSwitch", newChannel.voiceMembers.add(member, guild), newChannel, oldChannel);
Expand All @@ -380,16 +380,16 @@ class Shard extends EventEmitter {
* Fired when a guild member joins a voice channel. This event is not fired when a member switches voice channels, see `voiceChannelSwitch`
* @event Client#voiceChannelJoin
* @prop {Member} member The member
* @prop {CategoryChannel | TextChannel | VoiceChannel} newChannel The voice channel
* @prop {VoiceChannel} newChannel The voice channel
*/
this.emit("voiceChannelJoin", newChannel.voiceMembers.add(member, guild), newChannel);
}
} else if(oldChannel) {
/**
* Fired when a guild member leaves a voice channel. This event is not fired when a member switches voice channels, see `voiceChannelSwitch`
* @event Client#voiceChannelLeave
* @prop {Member} member The member
* @prop {CategoryChannel | TextChannel | VoiceChannel} oldChannel The voice channel
* @prop {?Member} member The member
* @prop {VoiceChannel} oldChannel The voice channel
*/
this.emit("voiceChannelLeave", oldChannel.voiceMembers.remove(member), oldChannel);
}
Expand Down