mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
Added support for server unavailability
it happened just now RIP discord server </3
This commit is contained in:
parent
5fa7bace10
commit
223753408c
3 changed files with 20 additions and 0 deletions
|
|
@ -1148,6 +1148,12 @@ var Client = (function () {
|
|||
var self = this;
|
||||
var server = this.getServer("id", data.id);
|
||||
|
||||
if (data.unavailable) {
|
||||
self.trigger("unavailable", data);
|
||||
self.debug("Server ID" + +" has been marked unavailable by Discord. It was not cached.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!server) {
|
||||
server = new Server(data, this);
|
||||
this.serverCache.push(server);
|
||||
|
|
|
|||
|
|
@ -1048,6 +1048,12 @@ class Client {
|
|||
var self = this;
|
||||
var server = this.getServer("id", data.id);
|
||||
|
||||
if(data.unavailable){
|
||||
self.trigger("unavailable", data);
|
||||
self.debug("Server ID" + + " has been marked unavailable by Discord. It was not cached.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!server) {
|
||||
server = new Server(data, this);
|
||||
this.serverCache.push(server);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ mybot.on("message", function (message) {
|
|||
|
||||
mybot.on("ready", function () {
|
||||
console.log("im ready");
|
||||
});
|
||||
|
||||
mybot.on("debug", function(info){
|
||||
console.log(info);
|
||||
})
|
||||
|
||||
mybot.on("unavailable", function(info){
|
||||
console.log("warning!", info);
|
||||
})
|
||||
|
||||
function dump(msg) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue