Move to data folder

This commit is contained in:
Frostbide
2025-04-25 12:03:13 -07:00
parent 63ab90330d
commit 9a00e09b9d
6 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,4 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*

View File

@@ -4,7 +4,7 @@
"description": "Discord utility bot",
"main": "src/index.js",
"scripts": {
"start": "mkdir -p src/logs && while true; do node --no-warnings src/index.js; [ $? -ne 0 ] || break; done",
"start": "mkdir -p src/data/logs && while true; do node --no-warnings src/index.js; [ $? -ne 0 ] || break; done",
"dev": "DEVELOPMENT=true node --no-warnings src/index.js"
},
"repository": {

0
src/data/.gitkeep Normal file
View File

0
src/data/logs/.gitkeep Normal file
View File

View File

@@ -1,6 +1,6 @@
const sqlite3 = require('sqlite3').verbose();
const path = require('path');
const dbpath = path.join(__dirname, '..', 'data.db');
const dbpath = path.join(__dirname, '..', 'data', 'data.db');
function main(ctx) {
const { bot, options } = ctx;
bot.database = {

View File

@@ -2,14 +2,15 @@ const chalk = require('chalk');
const readline = require('readline');
const path = require('path');
const fs = require('fs');
const logDir = path.join(__dirname, '..', 'data', 'logs');
function main(ctx) {
const { bot, options } = ctx;
bot.logger = {
logDir: path.join(__dirname, '..', 'logs'),
logDir,
logPath: path.join(
path.join(__dirname, '..', 'logs'),
logDir,
Math.floor(+new Date() / 1000).toString() + '.log'
),
log(...args) {