Caching Server now gets actual ID

This commit is contained in:
hydrabolt
2015-08-14 12:33:46 +01:00
parent e4723c7dfe
commit a0d4fa930c

View File

@@ -58,7 +58,7 @@ exports.Client.prototype.cacheServer = function( id, cb, members ) {
.set( "authorization", this.token ) .set( "authorization", this.token )
.end( function( err, res ) { .end( function( err, res ) {
var dat = res.body; var dat = res.body;
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 ); var server = new Server( dat.region, dat.owner_id, dat.name, id, members || dat.members, dat.icon, dat.afk_timeout, dat.afk_channel_id );
request request
.get( Endpoints.SERVERS + "/" + id + "/channels" ) .get( Endpoints.SERVERS + "/" + id + "/channels" )
@@ -458,7 +458,7 @@ exports.Client.prototype.sendMessage = function( channel, message, cb, _mentions
} }
exports.Client.prototype.deleteMessage = function( message ) { exports.Client.prototype.deleteMessage = function( message, cb ) {
if ( !message ) if ( !message )
return false; return false;
@@ -468,7 +468,7 @@ exports.Client.prototype.deleteMessage = function( message ) {
request request
.del( Endpoints.CHANNELS + "/" + message.channel.id + "/messages/" + message.id ) .del( Endpoints.CHANNELS + "/" + message.channel.id + "/messages/" + message.id )
.set( "authorization", client.token ) .set( "authorization", client.token )
.end( function( err, res ) {} ); .end( cb );
} }
exports.Client.prototype.channelFromId = function( id ) { exports.Client.prototype.channelFromId = function( id ) {