1.2.2
This commit is contained in:
parent
2408257b44
commit
177f4e2b52
7 changed files with 70 additions and 32 deletions
|
@ -1,10 +1,4 @@
|
|||
exports.run = async (client, message, args) => {
|
||||
if(client.devmode === true) {
|
||||
return message.channel.send(
|
||||
"<:error:466995152976871434> This command has been disabled because Woomy is in development mode."
|
||||
);
|
||||
};
|
||||
|
||||
const settings = message.settings;
|
||||
|
||||
if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {});
|
||||
|
|
|
@ -14,7 +14,7 @@ exports.run = async (client, message, args) => {
|
|||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
guildOnly: false,
|
||||
aliases: [],
|
||||
permLevel: "User",
|
||||
|
|
|
@ -6,25 +6,45 @@ module.exports = client => {
|
|||
|
||||
client.lockActivity = false;
|
||||
|
||||
client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.version.number}`, 'ready');
|
||||
let guild, channel, channel1;
|
||||
|
||||
if(client.config.loggingServer.length > 0) {
|
||||
try {
|
||||
guild = client.guilds.cache.get(client.config.loggingServer)
|
||||
} catch(err) {
|
||||
client.logger.error("Could not find loggingServer server (is the ID valid?):\n" + err);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
if(client.config.consoleLogs.length > 0) {
|
||||
try {
|
||||
channel1 = client.guilds.cache.get(client.config.consoleLogs)
|
||||
} catch(err) {
|
||||
client.logger.error("Could not find consoleLogs channel (is the ID valid?):\n" + err);
|
||||
process.exit(1);
|
||||
};
|
||||
};
|
||||
|
||||
if(client.config.startupLogs.length > 0) {
|
||||
try {
|
||||
channel = guild.channels.cache.get(client.config.startupLogs)
|
||||
} catch(err) {
|
||||
client.logger.error("Could not find startupLogs channel (is the ID valid?):\n" + err);
|
||||
process.exit(1);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
let channel, channel1;
|
||||
|
||||
try {
|
||||
channel = client.guilds.cache.get('410990517841690625').channels.cache.get('570963998342643732');
|
||||
} catch(err) {};
|
||||
|
||||
try {
|
||||
channel1 = client.guilds.cache.get('410990517841690625').channels.cache.get('570963481189154822');
|
||||
} catch(err) {};
|
||||
|
||||
if(client.devmode == true) {
|
||||
client.logger.warn("Running in development mode.")
|
||||
prefix = client.config.defaultSettings.devprefix;
|
||||
} else {
|
||||
prefix = client.config.defaultSettings.prefix;
|
||||
channel.send(`\`${timestamp}\`: Ready event fired! Connected to ${client.users.cache.size} users in ${client.guilds.cache.size} guilds.`);
|
||||
channel1.send(`\`${timestamp}\`: **Ready event fired**`);
|
||||
if(channel1) {
|
||||
channel1.send(`Bot started at \`${timestamp}\``);
|
||||
};
|
||||
};
|
||||
|
||||
let randomActivity = activityArray.random();
|
||||
|
@ -37,4 +57,6 @@ module.exports = client => {
|
|||
client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"});
|
||||
};
|
||||
}, 30000);
|
||||
|
||||
client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.version.number}`, 'ready');
|
||||
};
|
||||
|
|
|
@ -2,17 +2,25 @@ const chalk = require("chalk");
|
|||
const moment = require("moment");
|
||||
|
||||
exports.log = (content, type = "log") => {
|
||||
const timestamp = chalk.grey(`[${moment().format("YYYY-MM-DD HH:mm:ss")}]`);
|
||||
const timestamp = `[${moment().format("YYYY-MM-DD HH:mm:ss")}]`;
|
||||
|
||||
let channel;
|
||||
|
||||
try {
|
||||
channel = client.guilds.cache.get(client.config.loggingServer).channels.cache.get(client.config.consoleLogs);
|
||||
} catch(err) {};
|
||||
|
||||
try { channel = client.guilds.cache.get('410990517841690625').channels.cache.get('570963481189154822'); } catch(err) {}
|
||||
var logToServer = false;
|
||||
|
||||
if(client.devmode === false && channel && guild.available) {
|
||||
logToServer = true;
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
case "info": {
|
||||
try {
|
||||
if (client.devmode == false) {
|
||||
channel.send(`\`${timestamp}\`: ` + content);
|
||||
if (logToServer == true) {
|
||||
channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content);
|
||||
};
|
||||
} catch(err) {};
|
||||
return console.log(`${timestamp} ${chalk.cyanBright(`[${type.toUpperCase()}]`)} ${content} `);
|
||||
|
@ -20,8 +28,8 @@ exports.log = (content, type = "log") => {
|
|||
|
||||
case "warn": {
|
||||
try {
|
||||
if (client.devmode == false) {
|
||||
channel.send(`\`${timestamp}\`: ` + content);
|
||||
if (logToServer == true) {
|
||||
channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content);
|
||||
};
|
||||
} catch(err) {};
|
||||
return console.log(`${timestamp} ${chalk.yellowBright(`[${type.toUpperCase()}]`)} ${content} `);
|
||||
|
@ -29,8 +37,8 @@ exports.log = (content, type = "log") => {
|
|||
|
||||
case "error": {
|
||||
try {
|
||||
if (client.devmode == false) {
|
||||
channel.send(`\`${timestamp}\`: ` + content);
|
||||
if (logToServer == true) {
|
||||
channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content);
|
||||
};
|
||||
} catch(err) {}
|
||||
return console.log(`${timestamp} ${chalk.redBright(`[${type.toUpperCase()}]`)} ${content} `);
|
||||
|
@ -38,8 +46,8 @@ exports.log = (content, type = "log") => {
|
|||
|
||||
case "debug": {
|
||||
try {
|
||||
if (client.devmode == false) {
|
||||
channel.send(`\`${timestamp}\`: ` + content);
|
||||
if (logToServer == true) {
|
||||
channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content);
|
||||
};
|
||||
} catch(err) {};
|
||||
return console.log(`${timestamp} ${chalk.magentaBright(`[${type.toUpperCase()}]`)} ${content} `);
|
||||
|
@ -47,14 +55,19 @@ exports.log = (content, type = "log") => {
|
|||
|
||||
case "cmd": {
|
||||
try {
|
||||
if (client.devmode == false) {
|
||||
channel.send(`\`${timestamp}\` ` + content);
|
||||
if (logToServer == true) {
|
||||
channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content);
|
||||
};
|
||||
} catch(err) {};
|
||||
return console.log(`${timestamp} ${chalk.whiteBright(`[${type.toUpperCase()}]`)} ${content}`);
|
||||
};
|
||||
|
||||
case "ready": {
|
||||
try {
|
||||
if (logToServer == true) {
|
||||
channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content);
|
||||
};
|
||||
} catch(err) {};
|
||||
return console.log(`${timestamp} ${chalk.greenBright (`[${type.toUpperCase()}]`)} ${content}`);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue