function formatTCBMessage(msg) {
  const urlStart = msg.indexOf("http");

  if (urlStart === -1)
    throw new Error("No URL contained in the given TCB message");

  const url = msg.slice(urlStart);
  const chapNum = url.slice(url.lastIndexOf("-") + 1);

  return `<@&${config.opus.discord.notifyRole}> One Piece chapter **${chapNum}** is out!\n${url}`;
}
/**
 * Fetch important elements from the TCB message and create a new message.
 *
 * @since       pre-1.0.0
 * @access      private
 *
 * @param {string} msg The discord message from TCB
 *
 * @return {string} A formatted message containing the chapter link.
 */
Fetch important elements from the TCB message and create a new message.

@param {string} msg The discord message from TCB

@return {string} A formatted message containing the chapter link.
Fetch important elements from the TCB message and create a new message . @param { string } msg The discord message from TCB @return { string } A formatted message containing the chapter link .
function formatTCBMessage(msg) {
  const urlStart = msg.indexOf("http");
  if (urlStart === -1)
    throw new Error("No URL contained in the given TCB message");
  const url = msg.slice(urlStart);
  const chapNum = url.slice(url.lastIndexOf("-") + 1);
  return `<@&${config.opus.discord.notifyRole}> One Piece chapter **${chapNum}** is out!\n${url}`;
}
function formatTCBMessage ( msg ) { const urlStart = msg . indexOf ( "http" ) ; if ( urlStart === - 1 ) throw new Error ( "No URL contained in the given TCB message" ) ; const url = msg . slice ( urlStart ) ; const chapNum = url . slice ( url . lastIndexOf ( "-" ) + 1 ) ; return ` ${ config . opus . discord . notifyRole } ${ chapNum } \n ${ url } ` ; }
Fetch important elements from the TCB message and create a new message.
Fetch important elements from the TCB message and create a new message .