2023-02-20 20:14:41 +00:00
|
|
|
const commands = [
|
|
|
|
{raw: "`/compare`", clickable: "</compare:1077058896469966889>"},
|
2023-02-20 20:17:37 +00:00
|
|
|
{raw: "`/relay set`", clickable: "</relay set:1077322799032578152>"},
|
|
|
|
{raw: "`/relay update`", clickable: "</relay update:1077322799032578152>"},
|
|
|
|
{raw: "`/relay disable`", clickable: "</relay disable:1077322799032578152>"},
|
2023-02-20 20:14:41 +00:00
|
|
|
{raw: "`/rolemenu`", clickable: "</rolemenu:1077058896469966892>"},
|
|
|
|
{raw: "`/watertime`", clickable: "</watertime:1077058896469966895>"},
|
|
|
|
{raw: "`/timetoheight`", clickable: "</timetoheight:1077058896469966894>"},
|
|
|
|
{raw: "`/setup compare`", clickable: "</setup compare:1077058896469966893>"},
|
|
|
|
{raw: "`/setup view`", clickable: "</setup view:1077058896469966893>"},
|
|
|
|
{raw: "`/setup reset`", clickable: "</setup reset:1077058896469966893>"},
|
|
|
|
{raw: "`/help`", clickable: "</help:1077058896469966890>"},
|
|
|
|
{raw: "`/tree`", clickable: "</tree:972648557796524032>"},
|
|
|
|
{raw: "`/top trees`", clickable: "</top trees:1051840665362894950>"},
|
|
|
|
{raw: "`/commands`", clickable: "</commands:1077058896469966888>"}
|
|
|
|
];
|
2023-02-01 03:51:10 +00:00
|
|
|
const fs = require('fs');
|
|
|
|
const replaceAll = require('string.prototype.replaceall');
|
2023-02-20 01:42:14 +00:00
|
|
|
const path = "./modules/input.txt";
|
|
|
|
const string = fs.readFileSync(path).toString();
|
2023-02-01 03:51:10 +00:00
|
|
|
let newString = replaceAll(string, '\* ', '');
|
2023-02-20 20:14:41 +00:00
|
|
|
newString = replaceAll(newString, '\n', '\\n');
|
2023-02-01 03:51:10 +00:00
|
|
|
newString = replaceAll(newString, '\t', ' - ');
|
2023-02-20 20:14:41 +00:00
|
|
|
commands.forEach(command => {
|
|
|
|
newString = replaceAll(newString, command.raw, command.clickable);
|
|
|
|
});
|
2023-02-01 03:51:10 +00:00
|
|
|
newString = replaceAll(newString, '`', '``');
|
2023-02-20 01:42:14 +00:00
|
|
|
fs.writeFileSync(path, newString);
|
2023-02-01 03:51:10 +00:00
|
|
|
return "Done";
|