mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
Added updateMessage
This commit is contained in:
@@ -68,12 +68,22 @@ var Cache = (function (_Array) {
|
||||
}
|
||||
};
|
||||
|
||||
Cache.prototype.update = function update(old, data) {
|
||||
var index = this.get(this.discrim, old);
|
||||
if (~index) {
|
||||
this[index] = data;
|
||||
return this[index];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Cache.prototype.remove = function remove(data) {
|
||||
var index = this.indexOf(data);
|
||||
if (~index) {
|
||||
this.splice(index, 1);
|
||||
} else {
|
||||
var item = this.get("id", data.id);
|
||||
var item = this.get(this.discrim, data.id);
|
||||
if (item) {
|
||||
this.splice(this.indexOf(item), 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user