channelPinsUpdate(): Emitted whenever the pins of a channel are updated. Due to the nature of the WebSocket event, not much information can be provided easily here - you need to manually check the pins yourself.
ready(): Emitted when the client becomes ready to start working.
PARAMETER
TYPE
DESCRIPTION
client.on("ready",function(){console.log(`the client becomes ready to start`);console.log(`I am ready! Logged in as ${client.user.tag}!`);console.log(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);client.user.setActivity("the upright organ");client.generateInvite(["SEND_MESSAGES","MANAGE_GUILD","MENTION_EVERYONE"]).then((link)=>{console.log(`Generated bot invite link: ${link}`);inviteLink=link;});});
reconnecting(): Emitted whenever the client tries to reconnect to the WebSocket.
PARAMETER
TYPE
DESCRIPTION
client.on("reconnecting",function(){console.log(`client tries to reconnect to the WebSocket`);});
resume(): Emitted whenever a WebSocket resumes.
PARAMETER
TYPE
DESCRIPTION
replayed
number
The number of events that were replayed
client.on("resume",function(replayed){console.log(`whenever a WebSocket resumes, ${replayed} replays`);});
roleCreate(): Emitted whenever a role is created.
PARAMETER
TYPE
DESCRIPTION
role
Role
The role that was created
client.on("roleCreate",function(role){console.error(`a role is created`);});
roleDelete(): Emitted whenever a guild role is deleted.
PARAMETER
TYPE
DESCRIPTION
role
Role
The role that was deleted
client.on("roleDelete",function(role){console.error(`a guild role is deleted`);});
roleUpdate(): Emitted whenever a guild role is updated.
PARAMETER
TYPE
DESCRIPTION
oldRole
Role
The role before the update
newRole
Role
The role after the update
client.on("roleUpdate",function(oldRole,newRole){console.error(`a guild role is updated`);});
typingStart(): Emitted whenever a user starts typing in a channel.
PARAMETER
TYPE
DESCRIPTION
channel
Channel
The channel the user started typing in
user
User
The user that started typing
client.on("typingStart",function(channel,user){console.log(`${user.tag} has started typing`);});
typingStop(): Emitted whenever a user stops typing in a channel.
PARAMETER
TYPE
DESCRIPTION
channel
Channel
The channel the user stopped typing in
user
User
The user that stopped typing
client.on("typingStop",function(channel,user){console.log(`${user.tag} has stopped typing`);});
userNoteUpdate(): Emitted whenever a note is updated.
PARAMETER
TYPE
DESCRIPTION
user
User
The user the note belongs to
oldNote
String
The note content before the update
newNote
String
The note content after the update
client.on("userNoteUpdate",function(user,oldNote,newNote){console.log(`a member's note is updated`);});
userUpdate(): Emitted whenever a user's details (e.g. username) are changed.
PARAMETER
TYPE
DESCRIPTION
oldUser
User
The user before the update
newUser
User
The user after the update
client.on("userUpdate",function(oldUser,newUser){console.log(`user's details (e.g. username) are changed`);});
voiceStateUpdate(): Emitted whenever a user changes voice state - e.g. joins/leaves a channel, mutes/unmutes.
PARAMETER
TYPE
DESCRIPTION
oldMember
GuildMember
The member before the voice state update
newMember
GuildMember
The member after the voice state update
client.on("voiceStateUpdate",function(oldMember,newMember){console.log(`a user changes voice state`);});