aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/lib/bot_code.ts
blob: 088db7231cd8f0a5d2e886a0581daa8044bd329a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import defaultBotCode from "../assets/bot_template.txt?raw";

const BOT_CODE_KEY = "bot_code";

export function getBotCode() {
  let botCode = localStorage.getItem(BOT_CODE_KEY);
  if (!botCode) {
    botCode = defaultBotCode;
  }
  return botCode;
}

export function saveBotCode(botCode: string) {
  localStorage.setItem(BOT_CODE_KEY, botCode);
}