mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Log more startup stuff
This commit is contained in:
@@ -74,7 +74,11 @@ client.on('ready', async () => {
|
|||||||
// Import command-leaderboard.json
|
// Import command-leaderboard.json
|
||||||
try {
|
try {
|
||||||
const results = client.importCommandLeaderboard();
|
const results = client.importCommandLeaderboard();
|
||||||
if (!results) client.logger.error('[LEADERBOARD] command-leaderboard.json is not formatted correctly.');
|
if (results) {
|
||||||
|
client.logger.info('[LEADERBOARD] command-leaderboard.json successfully loaded.');
|
||||||
|
} else {
|
||||||
|
client.logger.error('[LEADERBOARD] command-leaderboard.json is not formatted correctly.');
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[LEADERBOARD] Could not parse command-leaderboard.json:\n${err.stack}`);
|
client.logger.error(`[LEADERBOARD] Could not parse command-leaderboard.json:\n${err.stack}`);
|
||||||
}
|
}
|
||||||
@@ -82,7 +86,11 @@ client.on('ready', async () => {
|
|||||||
// Import command-last-run.json
|
// Import command-last-run.json
|
||||||
try {
|
try {
|
||||||
const results = client.importLastRun();
|
const results = client.importLastRun();
|
||||||
if (!results) client.logger.error('[LASTRUN] command-last-run.json is not formatted correctly.');
|
if (results) {
|
||||||
|
client.logger.info('[LASTRUN] command-last-run.json successfully loaded.');
|
||||||
|
} else {
|
||||||
|
client.logger.error('[LASTRUN] command-last-run.json is not formatted correctly.');
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[LASTRUN] Could not parse command-last-run.json:\n${err.stack}`);
|
client.logger.error(`[LASTRUN] Could not parse command-last-run.json:\n${err.stack}`);
|
||||||
}
|
}
|
||||||
@@ -91,11 +99,13 @@ client.on('ready', async () => {
|
|||||||
client.setInterval(() => {
|
client.setInterval(() => {
|
||||||
try {
|
try {
|
||||||
client.exportCommandLeaderboard();
|
client.exportCommandLeaderboard();
|
||||||
|
client.logger.info('[LEADERBOARD] command-leaderboard.json successfully exported.');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[LEADERBOARD] Failed to export command-leaderboard.json:\n${err.stack}`);
|
client.logger.error(`[LEADERBOARD] Failed to export command-leaderboard.json:\n${err.stack}`);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
client.exportLastRun();
|
client.exportLastRun();
|
||||||
|
client.logger.info('[LASTRUN] command-last-run.json successfully exported.');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[LASTRUN] Failed to export command-last-run.json:\n${err.stack}`);
|
client.logger.error(`[LASTRUN] Failed to export command-last-run.json:\n${err.stack}`);
|
||||||
}
|
}
|
||||||
@@ -104,7 +114,11 @@ client.on('ready', async () => {
|
|||||||
// Import blacklist
|
// Import blacklist
|
||||||
try {
|
try {
|
||||||
const results = client.importBlacklist();
|
const results = client.importBlacklist();
|
||||||
if (!results) client.logger.error('[BLACKLIST] blacklist.json is not formatted correctly.');
|
if (results) {
|
||||||
|
client.logger.info('[BLACKLIST] blacklist.json successfully loaded.');
|
||||||
|
} else {
|
||||||
|
client.logger.error('[BLACKLIST] blacklist.json is not formatted correctly.');
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[BLACKLIST] Could not parse blacklist.json:\n${err.stack}`);
|
client.logger.error(`[BLACKLIST] Could not parse blacklist.json:\n${err.stack}`);
|
||||||
}
|
}
|
||||||
@@ -137,13 +151,16 @@ client.on('ready', async () => {
|
|||||||
|
|
||||||
// Set up existing timers
|
// Set up existing timers
|
||||||
await client.timers.fetchAll();
|
await client.timers.fetchAll();
|
||||||
|
client.logger.info('[TIMERS] All timers imported.');
|
||||||
|
|
||||||
// Register all canvas fonts
|
// Register all canvas fonts
|
||||||
await client.registerFontsIn(path.join(__dirname, 'assets', 'fonts'));
|
await client.registerFontsIn(path.join(__dirname, 'assets', 'fonts'));
|
||||||
|
client.logger.info('[FONTS] All fonts loaded.');
|
||||||
|
|
||||||
// Fetch adult site list
|
// Fetch adult site list
|
||||||
try {
|
try {
|
||||||
await client.fetchAdultSiteList();
|
await client.fetchAdultSiteList();
|
||||||
|
client.logger.info('[ADULT SITES] Fetched adult site list.');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[ADULT SITES] Failed to fetch list\n${err.stack}`);
|
client.logger.error(`[ADULT SITES] Failed to fetch list\n${err.stack}`);
|
||||||
}
|
}
|
||||||
@@ -151,6 +168,7 @@ client.on('ready', async () => {
|
|||||||
// Fetch NSFW model
|
// Fetch NSFW model
|
||||||
try {
|
try {
|
||||||
await client.loadNSFWModel();
|
await client.loadNSFWModel();
|
||||||
|
client.logger.info('[NSFW MODEL] Loaded NSFW model.');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
client.logger.error(`[NSFW MODEL] Failed to load NSFW model\n${err.stack}`);
|
client.logger.error(`[NSFW MODEL] Failed to load NSFW model\n${err.stack}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user