feat(Collectors): make collectors auto-stop when relevant structures are deleted (#3632)

* Collectors: make Collectors automatically stop when Channel, Guild, or Message are deleted.

* fix potential error with DM collectors

* Message collectors dont have a `this.message` you dummy

* Fix(various): nitpicks, documentation, typings, and stray error

* Pleasing mr tslint

* fix: typings

* Grammatical fixes

Co-Authored-By: SpaceEEC <spaceeec@yahoo.com>

* Fixing the linting after space's suggestions

* docs(ReactionCollector): remove whitespace

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
BorgerKing
2020-01-19 05:24:55 -05:00
committed by SpaceEEC
parent 69c79a4136
commit cbb8db3058
3 changed files with 85 additions and 0 deletions

7
typings/index.d.ts vendored
View File

@@ -1023,6 +1023,9 @@ declare module 'discord.js' {
export class MessageCollector extends Collector<Snowflake, Message> {
constructor(channel: TextChannel | DMChannel, filter: CollectorFilter, options?: MessageCollectorOptions);
private _handleChannelDeletion(channel: GuildChannel): void;
private _handleGuildDeletion(guild: Guild): void;
public channel: Channel;
public options: MessageCollectorOptions;
public received: number;
@@ -1153,6 +1156,10 @@ declare module 'discord.js' {
export class ReactionCollector extends Collector<Snowflake, MessageReaction> {
constructor(message: Message, filter: CollectorFilter, options?: ReactionCollectorOptions);
private _handleChannelDeletion(channel: GuildChannel): void;
private _handleGuildDeletion(guild: Guild): void;
private _handleMessageDeletion(message: Message): void;
public message: Message;
public options: ReactionCollectorOptions;
public total: number;