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"]
|
VOLUME [ "/usr/src/app/logs", "/usr/src/app/persist"]
|
||||||
|
|
||||||
EXPOSE 3006/tcp
|
|
||||||
|
|
||||||
CMD ["npm", "run", "start"]
|
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";
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
||||||
|
|
||||||
import Logging from "@hibas123/nodelogging";
|
import Logging from "@hibas123/nodelogging";
|
||||||
|
import * as fs from "fs";
|
||||||
|
|
||||||
import * as dotenv from "dotenv";
|
import * as dotenv from "dotenv";
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
@ -14,7 +15,11 @@ import { createHash } from "crypto";
|
|||||||
import low from "lowdb";
|
import low from "lowdb";
|
||||||
import FileSync from "lowdb/adapters/FileSync";
|
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);
|
const db = low(adapter);
|
||||||
db.defaults({});
|
db.defaults({});
|
||||||
import { createTransport } from "nodemailer";
|
import { createTransport } from "nodemailer";
|
||||||
@ -71,9 +76,8 @@ async function check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
import Telegraf from "telegraf";
|
import Telegraf from "telegraf";
|
||||||
import * as fs from "fs";
|
|
||||||
const bot = new Telegraf(process.env.TG_TOKEN)
|
const bot = new Telegraf(process.env.TG_TOKEN)
|
||||||
const chatidFilename = "./chatid";
|
const chatidFilename = "./persist/chatid";
|
||||||
let chatid: number;
|
let chatid: number;
|
||||||
try {
|
try {
|
||||||
if (fs.existsSync(chatidFilename)) {
|
if (fs.existsSync(chatidFilename)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user