/** * Singleton helper to format messages */ export declare class MessageFormatter { static readonly QUOTE_REGEXP: RegExp; static readonly LINK_REGEXP: RegExp; static readonly LINK_TRUNCATE_LENGTH = 24; static readonly LINK_PATHNAME_TRUNCATE_LENGTH = 14; static readonly LINK_SEARCH_TRUNCATE_LENGTH = 10; private static instance?; /** * Escape a regexp * @param string */ static escapeRegExp(string: string): string; /** * Get command name from the message * @param message */ static parseCommand(message: string): { param: string; commandName: string; }; static getInstance(): MessageFormatter; /** * Format a raw message to html * @param message */ format(message: string, remove?: boolean, trusted?: boolean): string; /** * Escape html * @param message */ replaceHtml(message: string): string; /** * Replace green text-style messages * @see https://knowyourmeme.com/memes/greentext-stories * @param message */ replaceGreenTexts(message: string): string; /** * Replace newlines with
* @param message * @param remove * @param trusted */ replaceNewlines(message: string, remove?: boolean, trusted?: boolean): string; /** * Replace buttons * @param message * @param trusted */ replaceButtons(message: string, remove?: boolean, trusted?: boolean): string; /** * Create a button * @param display * @param action */ createButton(display: string, action: string): string; /** * Get the html code of a button * @param title * @param action * @param escape * @param trusted */ getButtonHtml(title: string, action: string, trusted?: boolean): string; /** * Replace images * @param message * @param remove * @param trusted Whether to limit the number of replacements */ replaceImages(message: string, remove?: boolean, trusted?: boolean): string; /** * Replace RisiBank images * @param message */ replaceRisiBankStickers(message: string, remove?: boolean): string; /** * Replace stickers in a raw message * @param message */ replaceStickers(message: string, remove?: boolean): string; /** * Replace links in the message */ replaceLinks(text: string, remove?: boolean): string; /** * Replace quotes in the message */ replaceQuotes(text: string): string; }