UNPKG

status-sharding

Version:

Welcome to Status Sharding! This package is designed to provide an efficient and flexible solution for sharding Discord bots, allowing you to scale your bot across multiple processes or workers.

29 lines (28 loc) 843 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProcessMessage = void 0; const types_1 = require("../types"); /** Message that is sent on IPC. */ class ProcessMessage { /** Instance of the cluster client or cluster. */ _instance; /** The nonce of the message. */ _nonce; /** The data of the message. */ data; /** Creates an instance of ProcessMessage. */ constructor(instance, data) { this.data = data.data; this._nonce = data._nonce; this._instance = instance; } /** Replies to the message. */ async reply(message) { return this._instance._sendInstance({ data: message, _type: types_1.MessageTypes.CustomReply, _nonce: this._nonce, }); } } exports.ProcessMessage = ProcessMessage;