This commit is contained in:
parent
87e33a3bd0
commit
a686ce24cc
@ -17,6 +17,4 @@ COPY lib/ /usr/src/app/lib
|
||||
|
||||
VOLUME [ "/usr/src/app/logs", "/usr/src/app/persist"]
|
||||
|
||||
EXPOSE 3006/tcp
|
||||
|
||||
CMD ["npm", "run", "start"]
|
10
src/index.ts
10
src/index.ts
@ -3,6 +3,7 @@ require('ssl-root-cas').inject();
|
||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
||||
|
||||
import Logging from "@hibas123/nodelogging";
|
||||
import * as fs from "fs";
|
||||
|
||||
import * as dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
@ -14,7 +15,11 @@ import { createHash } from "crypto";
|
||||
import low from "lowdb";
|
||||
import FileSync from "lowdb/adapters/FileSync";
|
||||
|
||||
const adapter = new FileSync<{ test }>("db.json");
|
||||
if (!fs.existsSync("./persist")) {
|
||||
fs.mkdirSync("./persist")
|
||||
}
|
||||
|
||||
const adapter = new FileSync<{ test }>("persist/db.json");
|
||||
const db = low(adapter);
|
||||
db.defaults({});
|
||||
import { createTransport } from "nodemailer";
|
||||
@ -71,9 +76,8 @@ async function check() {
|
||||
}
|
||||
|
||||
import Telegraf from "telegraf";
|
||||
import * as fs from "fs";
|
||||
const bot = new Telegraf(process.env.TG_TOKEN)
|
||||
const chatidFilename = "./chatid";
|
||||
const chatidFilename = "./persist/chatid";
|
||||
let chatid: number;
|
||||
try {
|
||||
if (fs.existsSync(chatidFilename)) {
|
||||
|
Loading…
Reference in New Issue
Block a user