mirror of
https://github.com/danbulant/discord.js
synced 2026-07-04 10:40:38 +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 {
|
export default class Cache extends Array {
|
||||||
constructor(discrim, limit) {
|
constructor(discrim, limit) {
|
||||||
super();
|
super();
|
||||||
this.discrim = discrim || "id";
|
this["discrim"] = discrim || "id";
|
||||||
this.discrimCache = {};
|
this["discrimCache"] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
get(key, value) {
|
get(key, value) {
|
||||||
|
|
@ -51,7 +51,7 @@ export default class Cache extends Array {
|
||||||
if (item) {
|
if (item) {
|
||||||
var index = this.indexOf(item);
|
var index = this.indexOf(item);
|
||||||
this[index] = data;
|
this[index] = data;
|
||||||
this.discrimCache[data[this.discrim]] = data;
|
this.discrimCache[data[this.discrim]] = this[index];
|
||||||
return this[index];
|
return this[index];
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ var request = require("superagent");
|
||||||
|
|
||||||
client.on("ready", () => {
|
client.on("ready", () => {
|
||||||
console.log("ready");
|
console.log("ready");
|
||||||
|
for (var server of client.servers) {
|
||||||
|
if (!(server instanceof Discord.Server)) {
|
||||||
|
console.log("FOUNDED");
|
||||||
|
}
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if(client.internal.websocket)
|
if(client.internal.websocket)
|
||||||
client.internal.websocket.close();
|
client.internal.websocket.close();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue