The Server Class is used to represent data about a server.
The Discord Client that the Server was cached by.
The region that the server is in, a String.
The server's name, as a String.
The server's id, as a String.
Aliases : users
The members in a server, an Array of User_ objects.
The channels in a server, an Array of Channel_ objects.
The icon ID of the server if it has one as a String, otherwise it is null.
A String that is the URL of the server icon if it has one, otherwise it is null.
A Number that is the AFK Timeout of the Server.
A Channel_ that represents the AFK Channel of the server if it has one, otherwise it is null.
The #general Channel_ of the server.
A User_ object representing the user that owns the server.
Note
When concatenated with a String, the object will become the server's name, e.g. "this is " + server
would be this is Discord API
if the server was called Discord API.
Gets a Channel_ that matches the specified criteria. E.g:
server.getChannel("id", 1243987349) // returns a Channel where channel.id === 1243987349
- key - a String that is the key
- value - a String that is the value
Gets a User_ that matches the specified criteria. E.g:
bot.getUser("id", 1243987349) // returns a user where user.id === 1243987349
- key - a String that is the key
- value - a String that is the value
Returns a Boolean depending on whether the Server's ID (server.id
) equals the object's ID (object.id
). You should always, always use this if you want to compare servers. NEVER do server1 == server2
.