Server¶
extends Equality
Stores information about a Discord Server.
Attributes¶
region¶
String, region of the server.
name¶
String, name of the server.
id¶
String, ID of the server - never changes.
channels¶
Channels in the server, a Cache of ServerChannel objects.
icon¶
ID/Hash of server icon, use server.iconURL
for an URL to the icon.
afkTimeout¶
Number, the AFK timeout in seconds before a user is classed as AFK. If there isn’t an AFK timeout, this will be null.
afkChannel¶
The channel where AFK users are moved to, ServerChannel object. If one isn’t set, this will be null.
iconURL¶
The URL of the Server’s icon. If the server doesn’t have an icon, this will be null.
createdAt¶
A Date referring to when the server was created.
Functions¶
rolesOfUser(user)¶
Aliases: rolesOf, rolesOfMember
Returns an array of the roles affecting a user server-wide.
usersWithRole(role)¶
Aliases: membersWithRole
Returns an array of users that have the specified role.
detailsOfUser(user)¶
Aliases detailsOf, detailsOfMember
Returns an object containing metadata of a user within the server, containing a structure similar to the following:
{
joinedAt: 1449339323747,
roles: [],
mute: false,
selfMute: false,
deaf: false,
selfDeaf: false,
nick: 'Nickname'
}
leave()¶
createInvite(options, callback)¶
client.createInvite(server, options, callback)
createRole(data, callback)¶
client.createRole(server, data, callback)
createChannel(name, type, callback)¶
client.createChannel(server, name, type, callback)
getBans(callback)¶
client.getBans(server, callback)
banMember(user, length, callback)¶
client.banMember(member, server, length, callback)
unbanMember(user, callback)¶
client.unbanMember(member, server, callback)
kickMember(user, callback)¶
client.kickMember(member, server, callback)
setNickname(nickname, user, callback)¶
client.setNickname(server, nickname, user, callback)