mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Fixed server update listener
This commit is contained in:
@@ -7,7 +7,6 @@ class Message{
|
||||
constructor(data, channel, client){
|
||||
this.channel = channel;
|
||||
this.client = client;
|
||||
console.log("update", data);
|
||||
this.nonce = data.nonce;
|
||||
this.attachments = data.attachments;
|
||||
this.tts = data.tts;
|
||||
|
||||
@@ -8,6 +8,10 @@ var TextChannel = require("./TextChannel.js");
|
||||
var VoiceChannel = require("./VoiceChannel.js");
|
||||
var Role = require("./Role.js");
|
||||
|
||||
var strictKeys = [
|
||||
"region", "ownerID", "name", "id", "icon", "afkTimeout", "afkChannelID"
|
||||
];
|
||||
|
||||
class Server extends Equality {
|
||||
constructor(data, client) {
|
||||
|
||||
@@ -78,6 +82,19 @@ class Server extends Equality {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
equalsStrict(obj){
|
||||
if(obj instanceof Server){
|
||||
for(var key of strictKeys){
|
||||
if(obj[key] !== this[key]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Server;
|
||||
Reference in New Issue
Block a user