diff --git a/packages/discord.js/src/sharding/Shard.js b/packages/discord.js/src/sharding/Shard.js index d0bccf09d6c4..0f4e81761409 100644 --- a/packages/discord.js/src/sharding/Shard.js +++ b/packages/discord.js/src/sharding/Shard.js @@ -370,6 +370,11 @@ class Shard extends EventEmitter { // Shard has resumed if (message._resume) { this.ready = true; + /** + * Emitted upon the shard's {@link Client#event:shardResume} event. + * @event Shard#resume + */ + this.emit(ShardEvents.Resume); return; } diff --git a/packages/discord.js/src/util/ShardEvents.js b/packages/discord.js/src/util/ShardEvents.js index 8da682266361..f5ba9616849c 100644 --- a/packages/discord.js/src/util/ShardEvents.js +++ b/packages/discord.js/src/util/ShardEvents.js @@ -8,6 +8,7 @@ * @property {string} Message message * @property {string} Ready ready * @property {string} Reconnecting reconnecting + * @property {string} Resume resume * @property {string} Spawn spawn */ @@ -23,5 +24,6 @@ module.exports = { Message: 'message', Ready: 'ready', Reconnecting: 'reconnecting', + Resume: 'resume', Spawn: 'spawn', }; diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 58545ef8249f..520274ae604c 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2635,6 +2635,7 @@ export interface ShardEventTypes { message: [message: any]; ready: []; reconnecting: []; + resume: []; spawn: [process: ChildProcess | Worker]; } @@ -5038,6 +5039,7 @@ export enum ShardEvents { Message = 'message', Ready = 'ready', Reconnecting = 'reconnecting', + Resume = 'resume', Spawn = 'spawn', }