mirror of
https://github.com/danbulant/discord.js
synced 2026-06-16 05:01:18 +00:00
Build changes & minor changes to Cache
This commit is contained in:
parent
cd4a70cfb2
commit
cb58bc5414
2 changed files with 8 additions and 4 deletions
|
|
@ -3,8 +3,8 @@
|
|||
export default class Cache extends Array {
|
||||
constructor(discrim, limit) {
|
||||
super();
|
||||
this.discrim = discrim || "id";
|
||||
this.discrimCache = {};
|
||||
this["discrim"] = discrim || "id";
|
||||
this["discrimCache"] = {};
|
||||
}
|
||||
|
||||
get(key, value) {
|
||||
|
|
@ -51,7 +51,7 @@ export default class Cache extends Array {
|
|||
if (item) {
|
||||
var index = this.indexOf(item);
|
||||
this[index] = data;
|
||||
this.discrimCache[data[this.discrim]] = data;
|
||||
this.discrimCache[data[this.discrim]] = this[index];
|
||||
return this[index];
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ var request = require("superagent");
|
|||
|
||||
client.on("ready", () => {
|
||||
console.log("ready");
|
||||
|
||||
for (var server of client.servers) {
|
||||
if (!(server instanceof Discord.Server)) {
|
||||
console.log("FOUNDED");
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
if(client.internal.websocket)
|
||||
client.internal.websocket.close();
|
||||
|
|
|
|||
Loading…
Reference in a new issue