Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord.js

Package Overview
Dependencies
Maintainers
1
Versions
1725
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord.js - npm Package Compare versions

Comparing version 2.6.8 to 2.7.0

14

hydrabot/commands.js

@@ -253,2 +253,16 @@ var Authority = require( "./authority.js" );

Commands["setusername"] = {
oplevel : 2,
fn : function( bot, params, message ){
var name = getKey( params, "name", "Boris Johnson" );
bot.setUsername(name, function(err){
if(err)
bot.reply(message, err);
})
}
}
Commands[ "icon" ] = {

@@ -255,0 +269,0 @@ oplevel: 0,

3

hydrabot/hydrabot.js

@@ -34,5 +34,2 @@ // If you did not clone discord.js, change the require parameter to `discord.js`

hydrabot.login( BotConfig.email, BotConfig.password );
console.log( "Starting up..." );
var time = Date.now();

@@ -39,0 +36,0 @@

@@ -14,5 +14,5 @@ var request = require( "superagent" );

var serverCreateRequests = []. globalLoginTime = Date.now();
var serverCreateRequests = [].globalLoginTime = Date.now();
function tp(time){
function tp( time ) {
return Date.now() - time;

@@ -271,3 +271,3 @@ }

this.debug("login called at " + globalLoginTime);
this.debug( "login called at " + globalLoginTime );

@@ -286,8 +286,8 @@ var self = this;

var token = this.tokenManager.getToken( email, password );
if(!token.match(/[^\w.-]+/g)){
if ( !token.match( /[^\w.-]+/g ) ) {
done( this.tokenManager.getToken( email, password ) );
self.debug("loaded token from caches in "+tp(globalLoginTime));
self.debug( "loaded token from caches in " + tp( globalLoginTime ) );
return;
}else{
self.debug("error getting token from caches, using default auth");
} else {
self.debug( "error getting token from caches, using default auth" );
}

@@ -304,3 +304,3 @@ }

self.websocket.close();
self.debug("failed to login in "+tp(globalLoginTime));
self.debug( "failed to login in " + tp( globalLoginTime ) );
} else {

@@ -310,3 +310,3 @@ if ( !noCache ) {

}
self.debug("loaded token from auth servers in "+tp(globalLoginTime));
self.debug( "loaded token from auth servers in " + tp( globalLoginTime ) );
done( token );

@@ -318,3 +318,5 @@ }

function done( token ) {
self.debug("using token " + token);
self.email = email;
self.password = password;
self.debug( "using token " + token );
self.token = token;

@@ -375,3 +377,3 @@ self.websocket.sendData();

self.debug("got ready packet");
self.debug( "got ready packet" );

@@ -400,3 +402,3 @@ var data = dat.d;

self.triggerEvent( "ready" );
self.debug("ready triggered");
self.debug( "ready triggered" );
}

@@ -458,6 +460,6 @@ } );

try{
try {
newMessage = new Message( data, channel );
}catch(e){
self.debug("dropped a message update packet");
} catch ( e ) {
self.debug( "dropped a message update packet" );
return;

@@ -531,2 +533,9 @@ }

} else if ( dat.t === "USER_UPDATE" ) {
if ( dat.d.id === self.user.id ) {
self.user.username = dat.d.username;
self.user.avatar = dat.d.avatar;
}
}

@@ -554,3 +563,3 @@ break;

self.debug("websocket conn open");
self.debug( "websocket conn open" );
this.sendData( "onopen" );

@@ -576,4 +585,4 @@

exports.Client.prototype.debug = function(msg){
this.triggerEvent("debug", ["[SL "+ tp(globalLoginTime) +"] " + msg]);
exports.Client.prototype.debug = function( msg ) {
this.triggerEvent( "debug", [ "[SL " + tp( globalLoginTime ) + "] " + msg ] );
}

@@ -887,2 +896,14 @@

exports.Client.prototype.setUsername = function( username, callback ) {
var self = this;
Internal.XHR.setUsername( self.token, self.user.avatar, self.email, null, self.password, username, function( err ) {
callback( err );
} );
}
exports.Client.prototype.getChannelLogs = function( channel, amount, callback ) {

@@ -986,3 +1007,3 @@ var self = this;

var normalChan = this.getChannels().filter( "id", id, true );
return normalChan || this.PMList.filter("id", id, true);
return normalChan || this.PMList.filter( "id", id, true );
}

@@ -989,0 +1010,0 @@

@@ -230,4 +230,2 @@ var request = require( "superagent" );

console.log(Endpoints.API + "/invite/" + inviteID);
request

@@ -246,2 +244,20 @@ .post( Endpoints.API + "/invite/" + inviteID )

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;
{
"name": "discord.js",
"version": "2.6.8",
"version": "2.7.0",
"description": "A way to interface with the Discord API",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc