mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Build changes & minor changes to Cache
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user