Document all the events

This commit is contained in:
Amish Shah
2016-08-20 00:15:04 +01:00
parent f8b2629b18
commit 65350348a8
26 changed files with 210 additions and 1 deletions

View File

@@ -28,4 +28,12 @@ class ChannelUpdateAction extends Action {
}
}
/**
* Emitted whenever a channel is updated - e.g. name change, topic change.
*
* @event Client#channelUpdate
* @param {Channel} oldChannel the channel before the update
* @param {Channel} newChannel the channel after the update
*/
module.exports = ChannelUpdateAction;

View File

@@ -46,4 +46,11 @@ class GuildDeleteAction extends Action {
}
}
/**
* Emitted whenever a guild becomes unavailable, likely due to a server outage.
*
* @event Client#guildUnavailable
* @param {Guild} guild the guild that has become unavailable.
*/
module.exports = GuildDeleteAction;

View File

@@ -45,4 +45,14 @@ class GuildMemberRemoveAction extends Action {
}
}
/**
* Emitted whenever a member leaves a guild, or is kicked.
*
* @event Client#guildMemberRemove
* @param {Guild} guild the guild that the member has left.
* @param {GuildMember} member the member that has left the guild.
*/
module.exports = GuildMemberRemoveAction;

View File

@@ -28,4 +28,14 @@ class GuildRoleCreate extends Action {
}
}
/**
* Emitted whenever a guild role is created.
*
* @event Client#guildRoleCreate
* @param {Guild} guild the guild that the role was created in.
* @param {Role} role the role that was created.
*/
module.exports = GuildRoleCreate;

View File

@@ -44,4 +44,12 @@ class GuildRoleDeleteAction extends Action {
}
}
/**
* Emitted whenever a guild role is deleted.
*
* @event Client#guildRoleDelete
* @param {Guild} guild the guild that the role was deleted in.
* @param {Role} role the role that was deleted.
*/
module.exports = GuildRoleDeleteAction;

View File

@@ -33,4 +33,13 @@ class GuildRoleUpdateAction extends Action {
}
}
/**
* Emitted whenever a guild role is updated.
*
* @event Client#guildRoleUpdated
* @param {Guild} guild the guild that the role was updated in.
* @param {Role} oldRole the role before the update.
* @param {Role} newRole the role after the update.
*/
module.exports = GuildRoleUpdateAction;

View File

@@ -35,4 +35,12 @@ class GuildUpdateAction extends Action {
}
}
/**
* Emitted whenever a guild is updated - e.g. name change.
*
* @event Client#guildUpdate
* @param {Guild} oldGuild the guild before the update.
* @param {Guild} newGuild the guild after the update.
*/
module.exports = GuildUpdateAction;

View File

@@ -33,4 +33,12 @@ class MessageUpdateAction extends Action {
}
}
/**
* Emitted whenever a message is updated - e.g. embed or content change.
*
* @event Client#messageUpdate
* @param {Message} oldMessage the message before the update.
* @param {Message} newMessage the message after the update.
*/
module.exports = MessageUpdateAction;

View File

@@ -33,4 +33,12 @@ class UserUpdateAction extends Action {
}
}
/**
* Emitted whenever a detail of the logged in User changes - e.g. username.
*
* @event Client#userUpdate
* @param {ClientUser} oldClientUser the client user before the update.
* @param {ClientUser} newClientUser the client user after the update.
*/
module.exports = UserUpdateAction;