import { DISCORD_CDN_BASE, EMOJI_A_ID, EMOJI_B_ID } from "./config"; import * as fs from "fs"; export const ADD_TO_DOCS = (msg: msg_meta, won: bracket_result) => { let addition_indicator: string = ``; let split_str: string = ` - **`; let result: string; switch (won) { case "NO_DATA": case "TIE": result = won; break; default: result = `` break; }; let docstring_to_add: string = `
Winner: ${result}


${msg.quote_a.value.split(split_str, 2)[1].slice(0, -2)}



${msg.quote_b.value.split(split_str, 2)[1].slice(0, -2)}
${addition_indicator}`; let docs: string = fs.readFileSync(`./docs/index.html`, `utf8`); docs = docs.replace(``, `${docstring_to_add}`); fs.writeFileSync(`./docs/index.html`, `${docs}`); }