mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Added username changing
This commit is contained in:
@@ -227,8 +227,6 @@ Internal.XHR.getServer = function( token, serverID, callback ) {
|
||||
|
||||
Internal.XHR.acceptInvite = function(token, inviteID, callback){
|
||||
|
||||
console.log(Endpoints.API + "/invite/" + inviteID);
|
||||
|
||||
request
|
||||
.post( Endpoints.API + "/invite/" + inviteID )
|
||||
.set( "authorization", token )
|
||||
@@ -242,4 +240,22 @@ Internal.XHR.acceptInvite = function(token, inviteID, callback){
|
||||
|
||||
}
|
||||
|
||||
Internal.XHR.setUsername = function(token, avatar, email, newPassword, password, username, callback){
|
||||
|
||||
request
|
||||
.patch(Endpoints.API + "/users/@me")
|
||||
.set( "authorization", token )
|
||||
.send({
|
||||
avatar : avatar,
|
||||
email : email,
|
||||
new_password : newPassword,
|
||||
password : password,
|
||||
username : username
|
||||
})
|
||||
.end(function(err){
|
||||
callback(err);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
exports.Internal = Internal;
|
||||
|
||||
Reference in New Issue
Block a user