Fixed DataStore, deprecation leftovers and a bit of Event Constants (#1841)

* Fixed leftover fetchThing and removed unused methods/error messages

* Added resume event constant and used event constants wherever possible

* Replaced mentions of removed method name with their new name.

* Fixed typo: resume -> resumed
This commit is contained in:
SpaceEEC
2017-08-28 00:11:28 +02:00
committed by Crawl
parent c4fecf6609
commit 65d9d46a3c
13 changed files with 22 additions and 32 deletions

View File

@@ -245,8 +245,8 @@ class TextBasedChannel {
*/
/**
* Similar to createCollector but in promise form. Resolves with a collection of messages that pass the specified
* filter.
* Similar to createMessageCollector but in promise form.
* Resolves with a collection of messages that pass the specified filter.
* @param {CollectorFilter} filter The filter function to use
* @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector
* @returns {Promise<Collection<Snowflake, Message>>}
@@ -279,7 +279,9 @@ class TextBasedChannel {
* @returns {Promise<Collection<Snowflake, Message>>} Deleted messages
*/
bulkDelete(messages, filterOld = false) {
if (!isNaN(messages)) return this.fetchMessages({ limit: messages }).then(msgs => this.bulkDelete(msgs, filterOld));
if (!isNaN(messages)) {
return this.messages.fetch({ limit: messages }).then(msgs => this.bulkDelete(msgs, filterOld));
}
if (messages instanceof Array || messages instanceof Collection) {
let messageIDs = messages instanceof Collection ? messages.keyArray() : messages.map(m => m.id);
if (filterOld) {