mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
Added more properties to the server
This commit is contained in:
12
index.js
12
index.js
@@ -25,7 +25,7 @@ exports.Client = function( options ) {
|
||||
|
||||
exports.Client.prototype.triggerEvent = function( event, args ) {
|
||||
|
||||
if ( !this.ready ) { //if we're not even loaded yet, don't try doing anything because it always ends badly!
|
||||
if ( !this.ready && event !== "raw" ) { //if we're not even loaded yet, don't try doing anything because it always ends badly!
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ exports.Client.prototype.cacheServer = function( id, cb, members ) {
|
||||
.set( "authorization", this.token )
|
||||
.end( function( err, res ) {
|
||||
var dat = res.body;
|
||||
var server = new Server( dat.region, dat.owner_id, dat.name, dat.roles[ 0 ].id, members || dat.members );
|
||||
var server = new Server( dat.region, dat.owner_id, dat.name, dat.roles[ 0 ].id, members || dat.members, dat.icon, dat.afk_timeout, dat.afk_channel_id );
|
||||
|
||||
request
|
||||
.get( Endpoints.SERVERS + "/" + id + "/channels" )
|
||||
@@ -105,6 +105,14 @@ exports.Client.prototype.login = function( email, password ) {
|
||||
|
||||
}
|
||||
|
||||
exports.Client.prototype.reply = function(){
|
||||
|
||||
arguments[1] = arguments[0].author.mention() + ", " + arguments[1];
|
||||
|
||||
this.sendMessage.apply(this, arguments);
|
||||
|
||||
}
|
||||
|
||||
exports.Client.prototype.connectWebsocket = function( cb ) {
|
||||
|
||||
var client = this;
|
||||
|
||||
Reference in New Issue
Block a user