discord.js
Advanced tools
Comparing version 3.1.1 to 3.1.2
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
} |
@@ -0,0 +0,0 @@ // Available variables which can be used inside of strings. |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -123,3 +123,2 @@ //discord.js modules | ||
this.createws(); | ||
return new Promise(function (resolve, reject) { | ||
@@ -147,5 +146,11 @@ if (self.state === 0 || self.state === 4) { | ||
self.token = res.body.token; //set our token | ||
self.trySendConnData(); | ||
callback(null, self.token); | ||
resolve(self.token); | ||
getGateway().then(function (url) { | ||
self.createws(url); | ||
callback(null, self.token); | ||
resolve(self.token); | ||
})["catch"](function (err) { | ||
callback(err); | ||
reject(err); | ||
}); | ||
} | ||
@@ -692,3 +697,3 @@ }); | ||
key: "createws", | ||
value: function createws() { | ||
value: function createws(url) { | ||
if (this.websocket) return false; | ||
@@ -699,3 +704,3 @@ | ||
//good to go | ||
this.websocket = new WebSocket(Endpoints.WEBSOCKET_HUB); | ||
this.websocket = new WebSocket(url); | ||
@@ -1420,2 +1425,17 @@ //open | ||
function getGateway() { | ||
var self = this; | ||
return new Promise(function (resolve, reject) { | ||
request.get(Endpoints.API + "/gateway").end(function (err, res) { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(res.body.url); | ||
} | ||
}); | ||
}); | ||
} | ||
module.exports = Client; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "discord.js", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "A way to interface with the Discord API", | ||
@@ -11,3 +11,3 @@ "main": "./lib/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/discord-js/discord.js.git" | ||
"url": "git+https://github.com/hydrabolt/discord.js.git" | ||
}, | ||
@@ -25,5 +25,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/discord-js/discord.js/issues" | ||
"url": "https://github.com/hydrabolt/discord.js/issues" | ||
}, | ||
"homepage": "https://github.com/discord-js/discord.js#readme", | ||
"homepage": "https://github.com/hydrabolt/discord.js#readme", | ||
"dependencies": { | ||
@@ -30,0 +30,0 @@ "superagent": "^1.3.0", |
# discord.js | ||
[![Build Status](https://travis-ci.org/discord-js/discord.js.svg)](https://travis-ci.org/discord-js/discord.js) | ||
[![Build Status](https://travis-ci.org/hydrabolt/discord.js.svg)](https://travis-ci.org/hydrabolt/discord.js) | ||
@@ -5,0 +5,0 @@ discord.js is a node module used as a way of interfacing with |
@@ -135,3 +135,2 @@ //discord.js modules | ||
this.createws(); | ||
return new Promise(function (resolve, reject) { | ||
@@ -161,5 +160,12 @@ if (self.state === 0 || self.state === 4) { | ||
self.token = res.body.token; //set our token | ||
self.trySendConnData(); | ||
callback(null, self.token); | ||
resolve(self.token); | ||
getGateway().then(function (url) { | ||
self.createws(url); | ||
callback(null, self.token); | ||
resolve(self.token); | ||
}).catch(function (err) { | ||
callback(err); | ||
reject(err); | ||
}); | ||
} | ||
@@ -671,3 +677,3 @@ | ||
//def createws | ||
createws() { | ||
createws(url) { | ||
if (this.websocket) | ||
@@ -679,3 +685,3 @@ return false; | ||
//good to go | ||
this.websocket = new WebSocket(Endpoints.WEBSOCKET_HUB); | ||
this.websocket = new WebSocket(url); | ||
@@ -1113,2 +1119,20 @@ //open | ||
function getGateway() { | ||
var self = this; | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.get(`${Endpoints.API}/gateway`) | ||
.end(function (err, res) { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(res.body.url); | ||
} | ||
}); | ||
}); | ||
} | ||
module.exports = Client; |
@@ -0,0 +0,0 @@ exports.BASE_DOMAIN = "discordapp.com"; |
@@ -0,0 +0,0 @@ var request = require("superagent"); |
@@ -0,0 +0,0 @@ var request = require( "superagent" ); |
@@ -0,0 +0,0 @@ class Invite { |
@@ -0,0 +0,0 @@ class Message{ |
@@ -0,0 +0,0 @@ class PMChannel { |
@@ -0,0 +0,0 @@ class User{ |
@@ -10,4 +10,12 @@ /* | ||
function init(){ | ||
console.log("preparing..."); | ||
} | ||
mybot.on("ready", function(){ | ||
console.log("ready! beginning tests"); | ||
success1(); | ||
}); | ||
function success1(){ //make server | ||
console.log("preparing..."); | ||
mybot.createServer("test-server", "london").then(success2).catch(error); | ||
@@ -127,2 +135,2 @@ } | ||
mybot.login(process.env["ds_email"], process.env["ds_password"]).then(success1).catch(error); | ||
mybot.login(process.env["ds_email"], process.env["ds_password"]).then(init).catch(error); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137515
266626
3412
35
194