mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 12:11:11 +00:00
Added cache.random() and node engine to package.json
This commit is contained in:
parent
1042dfbcfe
commit
4ba90f36fe
3 changed files with 51 additions and 40 deletions
|
|
@ -83,6 +83,10 @@ var Cache = (function (_Array) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Cache.prototype.random = function random() {
|
||||||
|
return this[Math.floor(Math.random() * this.length)];
|
||||||
|
};
|
||||||
|
|
||||||
Cache.prototype.remove = function remove(data) {
|
Cache.prototype.remove = function remove(data) {
|
||||||
var index = this.indexOf(data);
|
var index = this.indexOf(data);
|
||||||
if (~index) {
|
if (~index) {
|
||||||
|
|
|
||||||
|
|
@ -37,5 +37,8 @@
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"node-opus": "^0.1.11"
|
"node-opus": "^0.1.11"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -62,6 +62,10 @@ class Cache extends Array {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
random() {
|
||||||
|
return this[Math.floor(Math.random()*this.length)];
|
||||||
|
}
|
||||||
|
|
||||||
remove(data) {
|
remove(data) {
|
||||||
var index = this.indexOf(data);
|
var index = this.indexOf(data);
|
||||||
if (~index) {
|
if (~index) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue