mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 13:33:30 +01:00
Added cache.random() and node engine to package.json
This commit is contained in:
@@ -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) {
|
||||
var index = this.indexOf(data);
|
||||
if (~index) {
|
||||
|
||||
@@ -37,5 +37,8 @@
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"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) {
|
||||
var index = this.indexOf(data);
|
||||
if (~index) {
|
||||
|
||||
Reference in New Issue
Block a user