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 all 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
16 changes: 11 additions & 5 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>
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>;
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 @@ -2095,9 +2101,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.

152 changes: 77 additions & 75 deletions lib/gateway/Shard.js

Large diffs are not rendered by default.

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
54 changes: 27 additions & 27 deletions lib/structures/GroupChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const User = require("./User");
/**
* [USER ACCOUNT] Represents a group channel. See PrivateChannel docs for additional properties.
* @extends PrivateChannel
* @prop {String} id The ID of the channel
* @prop {String} mention A string that mentions the channel
* @prop {Call?} call The current group call, if any
* @prop {Call?} lastCall The previous group call, if any
* @prop {Collection<User>} recipients The recipients in this private channel
* @prop {String} name The name of the group channel
* @prop {String?} icon The hash of the group channel icon
* @prop {String?} iconURL The URL of the group channel icon
* @prop {String} id The ID of the channel
* @prop {Call?} lastCall The previous group call, if any
* @prop {String} mention A string that mentions the channel
* @prop {String} name The name of the group channel
* @prop {String} ownerID The ID of the user that is the group owner
* @prop {Collection<User>} recipients The recipients in this private channel
*/
class GroupChannel extends PrivateChannel { // (╯°□°)╯︵ ┻━┻
constructor(data, client) {
Expand All @@ -40,16 +40,8 @@ class GroupChannel extends PrivateChannel { // (╯°□°)╯︵ ┻━┻
}
}

/**
* [USER ACCOUNT] Edit the channel's properties
* @arg {Object} options The properties to edit
* @arg {String} [options.name] The name of the channel
* @arg {String} [options.icon] The icon of the channel as a base64 data URI (group channels only). Note: base64 strings alone are not base64 data URI strings
* @arg {String} [options.ownerID] The ID of the channel owner (group channels only)
* @returns {Promise<GroupChannel>}
*/
edit(options) {
return this.client.editChannel.call(this.client, this.id, options);
get iconURL() {
return this.icon ? this.client._formatImage(Endpoints.CHANNEL_ICON(this.id, this.icon)) : null;
}

/**
Expand All @@ -62,25 +54,33 @@ class GroupChannel extends PrivateChannel { // (╯°□°)╯︵ ┻━┻
}

/**
* [USER ACCOUNT] Remove a user from the group
* @arg {String} userID The ID of the target user
* @returns {Promise}
* Get the group's icon with the given format and size
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
*/
removeRecipient(userID) {
return this.client.removeGroupRecipient.call(this.client, this.id, userID);
dynamicIconURL(format, size) {
return this.icon ? this.client._formatImage(Endpoints.CHANNEL_ICON(this.id, this.icon), format, size) : null;
}

get iconURL() {
return this.icon ? this.client._formatImage(Endpoints.CHANNEL_ICON(this.id, this.icon)) : null;
/**
* [USER ACCOUNT] Edit the channel's properties
* @arg {Object} options The properties to edit
* @arg {String} [options.name] The name of the channel
* @arg {String} [options.icon] The icon of the channel as a base64 data URI (group channels only). Note: base64 strings alone are not base64 data URI strings
* @arg {String} [options.ownerID] The ID of the channel owner (group channels only)
* @returns {Promise<GroupChannel>}
*/
edit(options) {
return this.client.editChannel.call(this.client, this.id, options);
}

/**
* Get the group's icon with the given format and size
* @arg {String} [format] The filetype of the icon ("jpg", "jpeg", "png", "gif", or "webp")
* @arg {Number} [size] The size of the icon (any power of two between 16 and 4096)
* [USER ACCOUNT] Remove a user from the group
* @arg {String} userID The ID of the target user
* @returns {Promise}
*/
dynamicIconURL(format, size) {
return this.icon ? this.client._formatImage(Endpoints.CHANNEL_ICON(this.id, this.icon), format, size) : null;
removeRecipient(userID) {
return this.client.removeGroupRecipient.call(this.client, this.id, userID);
}

toJSON(props = []) {
Expand Down
Loading