From d8b7365e1fb6de98481a773c309a3222999c0c3f Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Sun, 30 Aug 2015 16:31:21 +0100 Subject: [PATCH] Added authentication for examples and moved promise --- examples/auth.json | 6 ++++++ src/Client.js | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 examples/auth.json diff --git a/examples/auth.json b/examples/auth.json new file mode 100644 index 000000000..ce847c692 --- /dev/null +++ b/examples/auth.json @@ -0,0 +1,6 @@ +{ + //this is an authentication file used for the examples, + //just add your email and password and the examples should work! + "email" : "discord@js.com", + "password" : "my discord password" +} \ No newline at end of file diff --git a/src/Client.js b/src/Client.js index 382f0d4f3..8e2159b1d 100644 --- a/src/Client.js +++ b/src/Client.js @@ -375,8 +375,8 @@ class Client { deleteMessage(message, timeout, callback = function (err, msg) { }) { var self = this; - - return new Promise(function (resolve, reject) { + + var prom = new Promise(function (resolve, reject) { if (timeout) { setTimeout(remove, timeout) } else { @@ -398,6 +398,8 @@ class Client { }); } }); + + return prom; } updateMessage(message, content, callback = function (err, msg) { }) {