static async sendToTextChannel(discordChannel, text) {
    let remainingText = text;
    while (remainingText.length > MaxTextLength) {
      let nextPart = remainingText.slice(0, Math.max(0, MaxTextLength));
      const lastLineSymbol = nextPart.lastIndexOf('\n');
      if (lastLineSymbol >= 0) {
        nextPart = nextPart.slice(0, Math.max(0, lastLineSymbol));
        remainingText = remainingText.slice(Math.max(0, lastLineSymbol + 1));
      } else {
        remainingText = remainingText.slice(Math.max(0, MaxTextLength));
      }

      // Must preserve the order of messages, so ignoring the warning about parallel processing.
      /* eslint-disable no-await-in-loop */
      await discordChannel.send(nextPart);
      /* eslint-enable no-await-in-loop */
    }

    await discordChannel.send(remainingText);
  }
/**
   * Sends a message to Discord channel, considering the hard limit of symbols to be posted.
   * If the length is more than the limits, splits the message into several, if possible - at the line end
   * closest to the limit.
   * @param  {Channel}  discordChannel the Discord text channel
   * @param  {string}   text           the text to be posted
   * @return {Promise}                 nothing
   */
Sends a message to Discord channel, considering the hard limit of symbols to be posted.
If the length is more than the limits, splits the message into several, if possible - at the line end
closest to the limit.
@param  {Channel}  discordChannel the Discord text channel
@param  {string}   text           the text to be posted
@return {Promise}                 nothing
Sends a message to Discord channel considering the hard limit of symbols to be posted . If the length is more than the limits splits the message into several if possible - at the line end closest to the limit . @param { Channel } discordChannel the Discord text channel @param { string } text the text to be posted @return { Promise } nothing
static async sendToTextChannel(discordChannel, text) {
    let remainingText = text;
    while (remainingText.length > MaxTextLength) {
      let nextPart = remainingText.slice(0, Math.max(0, MaxTextLength));
      const lastLineSymbol = nextPart.lastIndexOf('\n');
      if (lastLineSymbol >= 0) {
        nextPart = nextPart.slice(0, Math.max(0, lastLineSymbol));
        remainingText = remainingText.slice(Math.max(0, lastLineSymbol + 1));
      } else {
        remainingText = remainingText.slice(Math.max(0, MaxTextLength));
      }
      await discordChannel.send(nextPart);
    }
    await discordChannel.send(remainingText);
  }
static async sendToTextChannel ( discordChannel , text ) { let remainingText = text ; while ( remainingText . length > MaxTextLength ) { let nextPart = remainingText . slice ( 0 , Math . max ( 0 , MaxTextLength ) ) ; const lastLineSymbol = nextPart . lastIndexOf ( '\n' ) ; if ( lastLineSymbol >= 0 ) { nextPart = nextPart . slice ( 0 , Math . max ( 0 , lastLineSymbol ) ) ; remainingText = remainingText . slice ( Math . max ( 0 , lastLineSymbol + 1 ) ) ; } else { remainingText = remainingText . slice ( Math . max ( 0 , MaxTextLength ) ) ; } await discordChannel . send ( nextPart ) ; } await discordChannel . send ( remainingText ) ; }
Sends a message to Discord channel, considering the hard limit of symbols to be posted.
Sends a message to Discord channel considering the hard limit of symbols to be posted .
// Must preserve the order of messages, so ignoring the warning about parallel processing. /* eslint-disable no-await-in-loop */ /* eslint-enable no-await-in-loop */