declare global { interface String { format(options: { [find: string]: string }): string; } } /* Useful little function to format strings for us */ String.prototype.format = function (options: { [find: string]: string }) { return this.replace(/{([^{}]+)}/g, (match: string, name: string) => { if (options[name] !== undefined) { return options[name]; } return match; }); }; /* Lots of strings! These are strings used in HTML or are shown to end users in embeds. */ export const Strings = { BASE_HTML: `{headers}`, ERROR_HTML: ` :(

Owie :(

You hit a snag that broke ${BRANDING_NAME}. It's not your fault though—This is usually caused by a Twitter outage or a new bug.

${RELEASE_NAME}

` .replace(/( {2})/g, '') .replace(/>[\s|\n]+<'), VERSION_HTML: ` ${BRANDING_NAME}

${BRANDING_NAME}

A better way to embed Tweets on Discord, Telegram, and more.

Worker release: ${RELEASE_NAME}


Stats for nerds:

Edge Connection: {rtt} 📶 {httpversion} 🔒 {tlsversion} ➡ {colo}

User Agent: {ua}

` .replace(/( {2})/g, '') .replace(/>[\s|\n]+<'), DEFAULT_AUTHOR_TEXT: 'Twitter', QUOTE_TEXT: `↘️ Quoting {name} (@{screen_name})`, TRANSLATE_TEXT: `↘️ Translated from {language}`, TRANSLATE_TEXT_INTL: `↘️ {source} ➡️ {destination}`, PHOTO_COUNT: `Photo {number} of {total}`, VIDEO_COUNT: `Video {number} of {total}`, SINGULAR_DAY_LEFT: 'day left', PLURAL_DAYS_LEFT: 'days left', SINGULAR_HOUR_LEFT: 'hour left', PLURAL_HOURS_LEFT: 'hours left', SINGULAR_MINUTE_LEFT: 'minute left', PLURAL_MINUTES_LEFT: 'minutes left', SINGULAR_SECOND_LEFT: 'second left', PLURAL_SECONDS_LEFT: 'seconds left', FINAL_POLL_RESULTS: 'Final results', ERROR_API_FAIL: 'Tweet failed to load due to an API error :(', ERROR_PRIVATE: `Sorry, we can't embed this Tweet because the user is private or suspended :(`, ERROR_TWEET_NOT_FOUND: `Sorry, that Tweet doesn't exist :(`, ERROR_UNKNOWN: `Unknown error occurred, sorry about that :(`, TWITFIX_API_SUNSET: `The original TwitFix API has been sunset. To learn more about the FixTweet API, check out ${API_HOST_LIST.split(',')[0]}`, DEPRECATED_DOMAIN_NOTICE: `We've moved! ➡ fxtwitter.com`, DEPRECATED_DOMAIN_NOTICE_DISCORD: `We've moved! ➡ fxtwitter.com` };