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

@@ -38,9 +38,6 @@ class DMChannel extends Channel {
// These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */
send() {}
fetchMessage() {}
fetchMessages() {}
fetchPinnedMessages() {}
search() {}
startTyping() {}
stopTyping() {}

View File

@@ -219,9 +219,6 @@ class GroupDMChannel extends Channel {
// These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */
send() {}
fetchMessage() {}
fetchMessages() {}
fetchPinnedMessages() {}
search() {}
startTyping() {}
stopTyping() {}

View File

@@ -285,7 +285,7 @@ class Message extends Base {
*/
/**
* Similar to createCollector but in promise form.
* Similar to createMessageCollector but in promise form.
* Resolves with a collection of reactions that pass the specified filter.
* @param {CollectorFilter} filter The filter function to use
* @param {AwaitReactionsOptions} [options={}] Optional options to pass to the internal collector

View File

@@ -73,9 +73,6 @@ class TextChannel extends GuildChannel {
// These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */
send() {}
fetchMessage() {}
fetchMessages() {}
fetchPinnedMessages() {}
search() {}
startTyping() {}
stopTyping() {}

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) {