From 5819fb4dafdf9343bfe2c1b2607a1591306446a6 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Sun, 27 Sep 2015 17:17:03 +0100 Subject: [PATCH] Fixed unavailable message --- lib/Client.js | 4 +++- src/Client.js | 4 +++- test/bot.1.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Client.js b/lib/Client.js index a885c6c28..ecacab82a 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -778,6 +778,8 @@ var Client = (function () { return; } + self.trigger("raw", dat); + //valid message switch (dat.t) { @@ -1150,7 +1152,7 @@ var Client = (function () { if (data.unavailable) { self.trigger("unavailable", data); - self.debug("Server ID" + +" has been marked unavailable by Discord. It was not cached."); + self.debug("Server ID " + data.id + " has been marked unavailable by Discord. It was not cached."); return; } diff --git a/src/Client.js b/src/Client.js index f6b8859d1..483f9ec3d 100644 --- a/src/Client.js +++ b/src/Client.js @@ -760,6 +760,8 @@ class Client { return; } + self.trigger("raw", dat); + //valid message switch (dat.t) { @@ -1050,7 +1052,7 @@ class Client { if(data.unavailable){ self.trigger("unavailable", data); - self.debug("Server ID" + + " has been marked unavailable by Discord. It was not cached."); + self.debug("Server ID " + data.id + " has been marked unavailable by Discord. It was not cached."); return; } diff --git a/test/bot.1.js b/test/bot.1.js index a79a36505..b615255c1 100644 --- a/test/bot.1.js +++ b/test/bot.1.js @@ -36,7 +36,7 @@ mybot.on("debug", function(info){ console.log(info); }) -mybot.on("unavailable", function(info){ +mybot.on("unknown", function(info){ console.log("warning!", info); })