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

Alphabetize jsdoc comments and methods in classes #2

Merged
merged 36 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
69d6fbe
Alphabetize oldPresence, oldState, oldMessage, oldRole, and emoji
jtsshieh Aug 19, 2020
7326caf
Alphabetize oldCall and and relationship in friendSuggestionCreate
jtsshieh Aug 19, 2020
559f472
Alphabetize props for Call, CategoryChannel, and Channel
jtsshieh Aug 20, 2020
bdd78fb
Alphabetize Guild
jtsshieh Aug 20, 2020
e4adff3
Alphabetize GuildAuditLogEntry
jtsshieh Aug 20, 2020
05c990f
Alphabetize GuildIntegration
jtsshieh Aug 20, 2020
90f0eec
Alphabetize GuildPreview
jtsshieh Aug 20, 2020
b0a729d
Alphabetize Invite
jtsshieh Aug 20, 2020
f83f281
Alphabetize Member
jtsshieh Aug 20, 2020
a311325
Alphabetize Message
jtsshieh Aug 20, 2020
0aea835
Fix PermissionOverwrite typing
jtsshieh Aug 20, 2020
32a63fd
Alphabetize Role
jtsshieh Aug 20, 2020
be7ecb0
Alphabetize User
jtsshieh Aug 20, 2020
5f85a8a
Alphabetize VoiceState
jtsshieh Aug 20, 2020
5cc202b
Alphabetize GuildChannel and fix typings for GuildChannel
jtsshieh Aug 20, 2020
0798e93
Alphabetize NewsChannel
jtsshieh Aug 20, 2020
5fd9692
Alphabetize PrivateChannel
jtsshieh Aug 20, 2020
8d28bd4
Alphabetize StoreChannel
jtsshieh Aug 20, 2020
bca0552
Alphabetize PrivateChannel method args
jtsshieh Aug 20, 2020
0bf68e6
Alphabetize TextChannel
jtsshieh Aug 20, 2020
775cb54
Alphabetize VoiceChannel
jtsshieh Aug 20, 2020
53a582d
Alphabetize Client
jtsshieh Aug 20, 2020
d52571d
Put Guild getters at the top
jtsshieh Aug 20, 2020
85b25e5
Add messageReference and more client options
jtsshieh Aug 20, 2020
b48b139
Add semicolons
jtsshieh Aug 20, 2020
18e140f
Alphabetize Client methods
jtsshieh Aug 20, 2020
3536bd0
Add bsian's commits
jtsshieh Aug 20, 2020
df4cd54
Add compute prune count
jtsshieh Aug 20, 2020
4ad309b
Merge remote-tracking branch 'origin/typings' into typings
jtsshieh Aug 20, 2020
2984592
Alphabetize oldGuild and oldChannel
jtsshieh Aug 20, 2020
8e0b81f
Add back in createdAt
jtsshieh Aug 20, 2020
3e6c17d
Add new docs
jtsshieh Aug 20, 2020
04fc6e8
Alphabetize GroupChannel
jtsshieh Aug 20, 2020
4e52165
Fix conflicts in Guild
jtsshieh Aug 20, 2020
d67ef60
Move permissionOf to correct location
jtsshieh Aug 20, 2020
5d14b9a
Remove extra space
bsian03 Aug 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,13 @@ declare namespace Eris {
largeThreshold?: number;
lastShardID?: number;
latencyThreshold?: number;
maxReconnectAttempts?: number;
maxResumeAttempts?: number;
maxShards?: number | "auto";
messageLimit?: number;
opusOnly?: boolean;
reconnectAttempts?: number;
rateLimiterOffset?: number;
requestTimeout?: number;
reconnectDelay?: ReconnectDelayFunction;
restMode?: boolean;
seedVoiceConnections?: boolean;
Expand Down Expand Up @@ -365,6 +368,7 @@ declare namespace Eris {
embeds: Embed[];
mentionedBy?: any;
mentions: string[];
pinned: boolean;
roleMentions: string[];
tts: boolean;
}
Expand Down Expand Up @@ -516,6 +520,7 @@ declare namespace Eris {
icon?: string;
region?: string;
roles?: PartialRole[];
systemChannelID: string;
verificationLevel?: number;
}
interface GetPruneOptions {
Expand Down Expand Up @@ -1306,6 +1311,7 @@ declare namespace Eris {
): Promise<Emoji>;
editGuildIntegration(guildID: string, integrationID: string, options: IntegrationOptions): Promise<void>;
editGuildMember(guildID: string, memberID: string, options: MemberOptions, reason?: string): Promise<void>;
editGuildWidget(guildID: string, options: Widget) : Promise<Widget>
bsian03 marked this conversation as resolved.
Show resolved Hide resolved
editMessage(channelID: string, messageID: string, content: MessageContent): Promise<Message>;
editNickname(guildID: string, nick: string, reason?: string): Promise<void>;
editRole(guildID: string, roleID: string, options: RoleOptions, reason?: string): Promise<Role>; // TODO not all options are available?
Expand Down Expand Up @@ -1348,6 +1354,7 @@ declare namespace Eris {
getGuildPreview(guildID: string): Promise<GuildPreview>;
getGuildVanity(guildID: string): Promise<{ code?: string; uses?: number }>;
getGuildWebhooks(guildID: string): Promise<Webhook[]>;
getGuildWidget(guildID: string) : Promise<Widget>;
bsian03 marked this conversation as resolved.
Show resolved Hide resolved
getInvite(inviteID: string, withCounts?: false): Promise<Invite & InviteWithoutMetadata<null>>;
getInvite(inviteID: string, withCounts: true): Promise<Invite & InviteWithoutMetadata<boolean>>;
getMessage(channelID: string, messageID: string): Promise<Message>;
Expand Down Expand Up @@ -1683,7 +1690,6 @@ declare namespace Eris {
position: number;
type: Exclude<ChannelTypes, 1 | 3>;
constructor(data: BaseData, guild: Guild);
createInvite(options?: CreateInviteOptions, reason?: string): Promise<Invite & InviteWithoutMetadata<null>>;
bsian03 marked this conversation as resolved.
Show resolved Hide resolved
delete(reason?: string): Promise<void>;
deletePermission(overwriteID: string, reason?: string): Promise<void>;
edit(options: Omit<EditChannelOptions, "icon" | "ownerID">, reason?: string): Promise<this>;
Expand Down Expand Up @@ -1825,8 +1831,8 @@ declare namespace Eris {
edit(content: MessageContent): Promise<Message<T>>;
getReaction(reaction: string, limit?: number, before?: string, after?: string): Promise<User[]>;
pin(): Promise<void>;
removeReactionEmoji(reaction: string): Promise<void>;
removeReaction(reaction: string, userID?: string): Promise<void>;
removeReactionEmoji(reaction: string): Promise<void>;
removeReactions(): Promise<void>;
unpin(): Promise<void>;
}
Expand Down Expand Up @@ -1857,7 +1863,6 @@ declare namespace Eris {
}

export class PermissionOverwrite extends Permission {
createdAt: number;
jtsshieh marked this conversation as resolved.
Show resolved Hide resolved
id: string;
type: PermissionType;
constructor(data: { allow: number; deny: number });
Expand Down Expand Up @@ -2095,9 +2100,9 @@ declare namespace Eris {
type: 2;
userLimit?: number;
voiceMembers: Collection<Member>;
getInvites(): Promise<(Invite & InviteWithMetadata<VoiceChannel>)[]>;
createInvite(options?: CreateInviteOptions, reason?: string): Promise<Invite & InviteWithoutMetadata<null, VoiceChannel>>;
join(options: VoiceResourceOptions): Promise<VoiceConnection>;
getInvites(): Promise<(Invite & InviteWithMetadata<VoiceChannel>)[]>;
join(options: { opusOnly?: boolean; shared?: boolean }): Promise<VoiceConnection>;
leave(): void;
}

Expand Down
2,682 changes: 1,342 additions & 1,340 deletions lib/Client.js

Large diffs are not rendered by default.

74 changes: 38 additions & 36 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,16 @@ class Shard extends EventEmitter {
* @event Client#presenceUpdate
* @prop {Member | Relationship} other The updated member or relationship
* @prop {Object?} oldPresence The old presence data. If the user was offline when the bot started and the client option getAllUsers is not true, this will be null
* @prop {String} oldPresence.status The other user's old status. Either "online", "idle", or "offline"
* @prop {Object?} oldPresence.game The old game the other user was playing
* @prop {String} oldPresence.game.name The name of the active game
* @prop {Number} oldPresence.game.type The type of the active game (0 is default, 1 is Twitch, 2 is YouTube)
* @prop {String} oldPresence.game.url The url of the active game
* @prop {Object[]?} oldPresence.activities The member's current activities
* @prop {Object?} oldPresence.clientStatus The member's per-client status
* @prop {String} oldPresence.clientStatus.web The member's status on web. Either "online", "idle", "dnd", or "offline". Will be "online" for bots
* @prop {String} oldPresence.clientStatus.desktop The member's status on desktop. Either "online", "idle", "dnd", or "offline". Will be "offline" for bots
* @prop {String} oldPresence.clientStatus.mobile The member's status on mobile. Either "online", "idle", "dnd", or "offline". Will be "offline" for bots
* @prop {Object[]?} oldPresence.activities The member's current activities
* @prop {Object?} oldPresence.game The old game the other user was playing
* @prop {String} oldPresence.game.name The name of the active game
* @prop {Number} oldPresence.game.type The type of the active game (0 is default, 1 is Twitch, 2 is YouTube)
* @prop {String} oldPresence.game.url The url of the active game
* @prop {String} oldPresence.status The other user's old status. Either "online", "idle", or "offline"
*/
this.emit("presenceUpdate", this.client.relationships.update(packet.d), oldPresence);
break;
Expand All @@ -309,10 +309,10 @@ class Shard extends EventEmitter {
let oldPresence = null;
if(member) {
oldPresence = {
game: member.game,
status: member.status,
activities: member.activities,
clientStatus: member.clientStatus,
activities: member.activities
game: member.game,
status: member.status
};
}
if((!member && packet.d.user.username) || oldPresence) {
Expand Down Expand Up @@ -377,10 +377,10 @@ class Shard extends EventEmitter {
}
}
const oldState = {
mute: member.voiceState.mute,
deaf: member.voiceState.deaf,
selfMute: member.voiceState.selfMute,
mute: member.voiceState.mute,
selfDeaf: member.voiceState.selfDeaf,
selfMute: member.voiceState.selfMute,
selfStream: member.voiceState.selfStream
};
const oldChannelID = member.voiceState.channelID;
Expand Down Expand Up @@ -433,10 +433,10 @@ class Shard extends EventEmitter {
* @event Client#voiceStateUpdate
* @prop {Member} member The member
* @prop {Object} oldState The old voice state
* @prop {Boolean} oldState.mute The previous server mute status
* @prop {Boolean} oldState.deaf The previous server deaf status
* @prop {Boolean} oldState.selfMute The previous self mute status
* @prop {Boolean} oldState.mute The previous server mute status
* @prop {Boolean} oldState.selfDeaf The previous self deaf status
* @prop {Boolean} oldState.selfMute The previous self mute status
* @prop {Boolean} oldState.selfStream The previous self stream status
*/
this.emit("voiceStateUpdate", member, oldState);
Expand Down Expand Up @@ -480,15 +480,15 @@ class Shard extends EventEmitter {
if(message) {
oldMessage = {
attachments: message.attachments,
channelMentions: message.channelMentions,
content: message.content,
embeds: message.embeds,
editedTimestamp: message.editedTimestamp,
embeds: message.embeds,
mentionedBy: message.mentionedBy,
mentions: message.mentions,
pinned: message.pinned,
roleMentions: message.roleMentions,
channelMentions: message.channelMentions,
tts: message.tts,
pinned: message.pinned
tts: message.tts
};
} else if(!packet.d.timestamp) {
packet.d.channel = channel;
Expand All @@ -501,15 +501,15 @@ class Shard extends EventEmitter {
* @prop {Message} message The updated message. If oldMessage is null, it is recommended to discard this event, since the message data will be very incomplete (only `id` and `channel` are guaranteed)
* @prop {Object?} oldMessage The old message data. If the message was cached, this will return the full old message. Otherwise, it will be null
* @prop {Object[]} oldMessage.attachments Array of attachments
* @prop {Object[]} oldMessage.embeds Array of embeds
* @prop {String[]} oldMessage.channelMentions Array of mentions channels' ids.
* @prop {String} oldMessage.content Message content
* @prop {Number} oldMessage.editedTimestamp Timestamp of latest message edit
* @prop {Object[]} oldMessage.embeds Array of embeds
* @prop {Object} oldMessage.mentionedBy Object of if different things mention the bot user
* @prop {Boolean} oldMessage.pinned Whether the message was pinned or not
* @prop {Boolean} oldMessage.tts Whether to play the message using TTS or not
* @prop {String[]} oldMessage.mentions Array of mentioned users' ids
* @prop {Boolean} oldMessage.pinned Whether the message was pinned or not
* @prop {String[]} oldMessage.roleMentions Array of mentioned roles' ids.
* @prop {String[]} oldMessage.channelMentions Array of mentions channels' ids.
* @prop {Boolean} oldMessage.tts Whether to play the message using TTS or not
*/
this.emit("messageUpdate", channel.messages.update(packet.d, this.client), oldMessage);
break;
Expand Down Expand Up @@ -698,8 +698,10 @@ class Shard extends EventEmitter {
/**
* Fired when someone removes all reactions from a message for a single emoji
* @event Client#messageReactionRemoveEmoji
* @prop {Message | Object} message The message object. If the message is not cached, this will be an object with `id`, `channel`, and if inside a guild, `guildID` keys. If the channel is not cached, channel key will be an object with only an id. No other property is guaranteed
* @prop {Object} emoji The emoji object with a `name` prop. If the emoji is a custom emoji it will also have an `id` prop.
* @prop {Message | Object} message The message object. If the message is not cached, this will be an object with `id` and `channel` keys. If the channel is not cached, channel key will be an object with only an id. No other property is guaranteed
* @prop {Object} emoji The reaction emoji object
* @prop {String?} emoji.id The ID of the emoji (null for non-custom emojis)
* @prop {String} emoji.name The emoji name
*/
this.emit("messageReactionRemoveEmoji", message, packet.d.emoji);
break;
Expand Down Expand Up @@ -981,24 +983,24 @@ class Shard extends EventEmitter {
color: role.color,
hoist: role.hoist,
managed: role.managed,
mentionable: role.mentionable,
name: role.name,
permissions: role.permissions,
position: role.position,
mentionable: role.mentionable
position: role.position
};
/**
* Fired when a guild role is updated
* @event Client#guildRoleUpdate
* @prop {Guild} guild The guild
* @prop {Role} role The updated role
* @prop {Object} oldRole The old role data
* @prop {String} oldRole.name The name of the role
* @prop {Boolean} oldRole.mentionable Whether the role is mentionable or not
* @prop {Boolean} oldRole.managed Whether a guild integration manages this role or not
* @prop {Boolean} oldRole.hoist Whether users with this role are hoisted in the user list or not
* @prop {Number} oldRole.color The hex color of the role in base 10
* @prop {Number} oldRole.position The position of the role
* @prop {Boolean} oldRole.hoist Whether users with this role are hoisted in the user list or not
* @prop {Boolean} oldRole.managed Whether a guild integration manages this role or not
* @prop {Boolean} oldRole.mentionable Whether the role is mentionable or not
* @prop {String} oldRole.name The name of the role
* @prop {Permission} oldRole.permissions The permissions number of the role
* @prop {Number} oldRole.position The position of the role
*/
this.emit("guildRoleUpdate", guild, guild.roles.update(packet.d.role, guild), oldRole);
break;
Expand Down Expand Up @@ -1262,21 +1264,21 @@ class Shard extends EventEmitter {
throw new Error("CALL_UPDATE but channel has no call");
}
const oldCall = {
endedTimestamp: channel.call.endedTimestamp,
participants: channel.call.participants,
ringing: channel.call.ringing,
region: channel.call.region,
endedTimestamp: channel.call.endedTimestamp,
ringing: channel.call.ringing,
unavailable: channel.call.unavailable
};
/**
* Fired when a call is updated
* @event Client#callUpdate
* @prop {Call} call The updated call
* @prop {Object} oldCall The old call data
* @prop {String[]} oldCall.participants The IDs of the call participants
* @prop {Number?} oldCall.endedTimestamp The timestamp of the call end
* @prop {String[]?} oldCall.ringing The IDs of people that were being rung
* @prop {String[]} oldCall.participants The IDs of the call participants
* @prop {String?} oldCall.region The region of the call server
* @prop {String[]?} oldCall.ringing The IDs of people that were being rung
* @prop {Boolean} oldCall.unavailable Whether the call was unavailable or not
*/
this.emit("callUpdate", channel.call.update(packet.d), oldCall);
Expand Down Expand Up @@ -1325,9 +1327,9 @@ class Shard extends EventEmitter {
* @event Client#friendSuggestionCreate
* @prop {User} user The suggested user
* @prop {String[]} reasons Array of reasons why this suggestion was made
* @prop {Number} reasons.type Type of reason?
* @prop {String} reasons.platform_type Platform you share with the user
* @prop {String} reasons.name Username of suggested user on that platform
* @prop {String} reasons.platform_type Platform you share with the user
* @prop {Number} reasons.type Type of reason?
*/
this.emit("friendSuggestionCreate", new User(packet.d.suggested_user, this.client), packet.d.reasons);
break;
Expand Down
4 changes: 2 additions & 2 deletions lib/structures/Call.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const VoiceState = require("./VoiceState");

/**
* Represents a call
* @prop {String} id The ID of the call
* @prop {Number} createdAt Timestamp of the call's creation
* @prop {GroupChannel} channel The call channel
* @prop {Number} createdAt Timestamp of the call's creation
* @prop {Number?} endedTimestamp The timestamp of the call end
* @prop {String} id The ID of the call
* @prop {String[]} participants The IDs of the call participants
* @prop {String?} region The region of the call server
* @prop {String[]?} ringing The IDs of people that still have not responded to the call request
Expand Down
12 changes: 7 additions & 5 deletions lib/structures/CategoryChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ const GuildChannel = require("./GuildChannel");
/**
* Represents a guild category channel
* @extends GuildChannel
* @prop {Collection<GuildChannel>} channels A collection of guild channels that are part of this category
* @prop {Client} client The client that initialized the channel
* @prop {Number} createdAt Timestamp of the channel's creation
* @prop {Guild} guild The guild that owns the channel
* @prop {String} id The ID of the channel
* @prop {String} mention A string that mentions the channel
* @prop {Number} type The type of the channel
* @prop {Guild} guild The guild that owns the channel
* @prop {String?} parentID The ID of the category this channel belongs to
* @prop {String} name The name of the channel
* @prop {Number} position The position of the channel
* @prop {Boolean} nsfw Whether the channel is an NSFW channel or not
* @prop {String?} parentID The ID of the category this channel belongs to
* @prop {Collection<PermissionOverwrite>} permissionOverwrites Collection of PermissionOverwrites in this channel
* @prop {Collection<GuildChannel>} channels A collection of guild channels that are part of this category
* @prop {Number} position The position of the channel
* @prop {Number} type The type of the channel
*/
class CategoryChannel extends GuildChannel {
get channels() {
Expand Down
2 changes: 1 addition & 1 deletion lib/structures/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const {ChannelTypes} = require("../Constants");

/**
* Represents a channel. You also probably want to look at CategoryChannel, GroupChannel, NewsChannel, PrivateChannel, TextChannel, and VoiceChannel.
* @prop {String} id The ID of the channel
* @prop {Client} client The client that initialized the channel
* @prop {Number} createdAt Timestamp of the channel's creation
* @prop {String} id The ID of the channel
* @prop {String} mention A string that mentions the channel
* @prop {Number} type The type of the channel
*/
Expand Down
Loading