readable logs pog
This commit is contained in:
8
index.js
8
index.js
@@ -22,7 +22,7 @@ const client = new Client({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
client.once(Events.ClientReady, readyClient => {
|
client.once(Events.ClientReady, readyClient => {
|
||||||
console.log(`Connected to Discord as ${readyClient.user.tag}`);
|
console.log(`Discord: Connected as ${readyClient.user.tag}`);
|
||||||
});
|
});
|
||||||
client.login(config.token);
|
client.login(config.token);
|
||||||
client.commands = new Collection();
|
client.commands = new Collection();
|
||||||
@@ -37,10 +37,10 @@ fs.readdir('./tasks/', (err, files) => {
|
|||||||
const taskName = file.split('.')[0];
|
const taskName = file.split('.')[0];
|
||||||
task[taskName] = taskFile;
|
task[taskName] = taskFile;
|
||||||
if (taskFile.schedule) {
|
if (taskFile.schedule) {
|
||||||
console.log(`Scheduling task "${taskName}" for ${taskFile.schedule}`);
|
console.log(`Tasks: Scheduling "${taskName}" for ${taskFile.schedule}`);
|
||||||
cron.schedule(taskFile.schedule, () => { taskFile(client, torn, config, state); });
|
cron.schedule(taskFile.schedule, () => { taskFile(client, torn, config, state); });
|
||||||
} else {
|
} else {
|
||||||
console.log(`Registered task "${taskName}"`);
|
console.log(`Tasks: Registered "${taskName}"`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -56,7 +56,7 @@ const commandFolders = fs.readdirSync(foldersPath);
|
|||||||
const command = require(filePath);
|
const command = require(filePath);
|
||||||
if ('data' in command && 'execute' in command) {
|
if ('data' in command && 'execute' in command) {
|
||||||
client.commands.set(command.data.name, command);
|
client.commands.set(command.data.name, command);
|
||||||
console.log(`Registered command "${command.data.name}"`);
|
console.log(`Commands: Registered "${command.data.name}"`);
|
||||||
} else {
|
} else {
|
||||||
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
|
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
|
||||||
}
|
}
|
||||||
|
|||||||
2
torn.js
2
torn.js
@@ -6,7 +6,7 @@ module.exports.readyCheck = async (key) => {
|
|||||||
const url = `https://api.torn.com/user/?selections=basic&key=${key}`
|
const url = `https://api.torn.com/user/?selections=basic&key=${key}`
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log(`Connected to Torn as ${data.name} [${data.player_id}]`);
|
console.log(`Torn: Connected as ${data.name} [${data.player_id}]`);
|
||||||
};
|
};
|
||||||
module.exports.test = async () => {
|
module.exports.test = async () => {
|
||||||
const url = `https://api.torn.com/user/?selections=basic&key=${config.torn}`
|
const url = `https://api.torn.com/user/?selections=basic&key=${config.torn}`
|
||||||
|
|||||||
Reference in New Issue
Block a user