324 FUCKING FORMATTING ERRORS
This commit is contained in:
parent
ec0cdd859f
commit
f555831aeb
6 changed files with 167 additions and 167 deletions
|
@ -5,7 +5,7 @@ module.exports = class {
|
|||
|
||||
async run () {
|
||||
await this.client.functions.wait(1000);
|
||||
this.client.user.setActivity(`BNA | v${this.client.version}`, { type: "WATCHING" }) // lol
|
||||
this.client.user.setActivity(`BNA | v${this.client.version}`, { type: 'WATCHING' }); // lol
|
||||
this.client.logger.ready(`Connected to Discord as ${this.client.user.tag}`);
|
||||
}
|
||||
};
|
||||
|
|
12
bot/index.js
12
bot/index.js
|
@ -5,7 +5,7 @@ const { CommandHandler, EventHandler } = require('./util/handlers');
|
|||
const Functions = require('./util/functions');
|
||||
const Database = require('./util/database');
|
||||
const logger = require('./util/logger');
|
||||
const sentry = require('@sentry/node');
|
||||
const sentry = require('@sentry/node'); // eslint-disable-line no-unused-vars
|
||||
const config = require('../config.json');
|
||||
const pkg = require('../package.json');
|
||||
|
||||
|
@ -23,7 +23,7 @@ class WoomyClient extends Client {
|
|||
if (this.config.devmode === true) {
|
||||
this.dev = true;
|
||||
// sentry.init({ dsn: this.config.keys.sentry });
|
||||
};
|
||||
}
|
||||
|
||||
// Essential modules
|
||||
this.logger = logger;
|
||||
|
@ -38,8 +38,8 @@ class WoomyClient extends Client {
|
|||
// Handlers, to load commands and events
|
||||
this.commandHandler = new CommandHandler(this);
|
||||
this.eventHandler = new EventHandler(this);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
const client = new WoomyClient();
|
||||
|
@ -54,8 +54,8 @@ async function init() {
|
|||
client.login(client.config.devtoken);
|
||||
} else {
|
||||
client.login(client.config.token);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
const discord = require("discord.js");
|
||||
const config = require("../config.json");
|
||||
const discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
|
||||
const manager = new discord.ShardingManager("./index.js", {
|
||||
totalShards: "auto",
|
||||
const manager = new discord.ShardingManager('./index.js', {
|
||||
totalShards: 'auto',
|
||||
token: config.token
|
||||
});
|
||||
|
||||
manager.on("shardCreate", (shard) => {
|
||||
console.log("Shard " + shard.id + " launched");
|
||||
manager.on('shardCreate', (shard) => {
|
||||
console.log('Shard ' + shard.id + ' launched');
|
||||
});
|
||||
|
||||
manager.spawn();
|
|
@ -4,7 +4,7 @@ const { inspect, promisify } = require('util');
|
|||
class Functions {
|
||||
constructor (client) {
|
||||
this.client = client;
|
||||
};
|
||||
}
|
||||
|
||||
userError (channel, cmd, error) {
|
||||
const embed = new MessageEmbed()
|
||||
|
@ -15,12 +15,12 @@ class Functions {
|
|||
.setFooter(`Run 'help ${cmd.help.name}' for more information.`);
|
||||
|
||||
channel.send(embed);
|
||||
};
|
||||
}
|
||||
|
||||
async getLastMessage (channel) {
|
||||
let messages = await channel.messages.fetch({ limit: 2 });
|
||||
return messages.last().content;
|
||||
};
|
||||
}
|
||||
|
||||
async awaitReply(message, question, limit = 60000) {
|
||||
const filter = (m) => m.author.id === message.author.id;
|
||||
|
@ -48,7 +48,7 @@ class Functions {
|
|||
try {
|
||||
match = guild.members.cache.find(x => x.displayName.toLowerCase() == query);
|
||||
if (!match) guild.members.cache.find(x => x.user.username.toLowerCase() == query);
|
||||
} catch (err) {};
|
||||
} catch (err) {} //eslint-disable-line no-empty
|
||||
|
||||
if (match) matches.push(match);
|
||||
guild.members.cache.forEach(member => {
|
||||
|
@ -58,25 +58,25 @@ class Functions {
|
|||
member.id != (match && match.id)
|
||||
) {
|
||||
matches.push(member);
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
return matches;
|
||||
};
|
||||
}
|
||||
|
||||
findRole (input, message) {
|
||||
let role;
|
||||
role = message.guild.roles.cache.find(r => r.name.toLowerCase() === input.toLowerCase());
|
||||
if(!role) {
|
||||
role = message.guild.roles.cache.get(input.toLowerCase());
|
||||
};
|
||||
}
|
||||
if(!role) return;
|
||||
return role;
|
||||
};
|
||||
}
|
||||
|
||||
intBetween (min, max) {
|
||||
return Math.round((Math.random() * (max - min) + min));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -85,8 +85,8 @@ class Functions {
|
|||
return true;
|
||||
} else {
|
||||
return false;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
shutdown () {
|
||||
const exitQuotes = [
|
||||
|
@ -99,34 +99,34 @@ class Functions {
|
|||
];
|
||||
|
||||
this.client.db.pool.end().then(() => {
|
||||
this.client.logger.info('Connection to database closed.')
|
||||
this.client.logger.info('Connection to database closed.');
|
||||
});
|
||||
|
||||
this.client.destroy();
|
||||
|
||||
console.log(exitQuotes);
|
||||
};
|
||||
}
|
||||
|
||||
async clean (text) {
|
||||
if (text && text.constructor.name === 'Promise') {
|
||||
text = await text;
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof text !== 'string') {
|
||||
text = inspect(text, { depth: 1});
|
||||
};
|
||||
}
|
||||
|
||||
text = text
|
||||
.replace(/`/g, "`" + String.fromCharCode(8203))
|
||||
.replace(/@/g, "@" + String.fromCharCode(8203))
|
||||
.replace(this.client.token, "mfa.VkO_2G4Qv3T--NO--lWetW_tjND--TOKEN--QFTm6YGtzq9PH--4U--tG0");
|
||||
.replace(/`/g, '`' + String.fromCharCode(8203))
|
||||
.replace(/@/g, '@' + String.fromCharCode(8203))
|
||||
.replace(this.client.token, 'mfa.VkO_2G4Qv3T--NO--lWetW_tjND--TOKEN--QFTm6YGtzq9PH--4U--tG0');
|
||||
|
||||
return text;
|
||||
};
|
||||
}
|
||||
|
||||
wait () {
|
||||
promisify(setTimeout);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Functions;
|
|
@ -1,4 +1,4 @@
|
|||
const fs = require("fs");
|
||||
const fs = require('fs');
|
||||
|
||||
class CommandHandler {
|
||||
constructor (client) {
|
||||
|
@ -7,7 +7,7 @@ class CommandHandler {
|
|||
|
||||
load (name, category) {
|
||||
try {
|
||||
const path = this.client.path + "/commands/" + category + "/" + name + ".js";
|
||||
const path = this.client.path + '/commands/' + category + '/' + name + '.js';
|
||||
const props = new (require(path))(this.client);
|
||||
|
||||
this.client.logger.debug(`Loading command ${category}/${name}`);
|
||||
|
@ -34,11 +34,11 @@ class CommandHandler {
|
|||
}
|
||||
|
||||
loadAll () {
|
||||
const commandDirectories = fs.readdirSync("./commands/");
|
||||
const commandDirectories = fs.readdirSync('./commands/');
|
||||
this.client.logger.debug(`Found ${commandDirectories.length} command directories.`);
|
||||
commandDirectories.forEach((dir) => {
|
||||
const commandFiles = fs.readdirSync("./commands/" + dir + "/");
|
||||
commandFiles.filter((cmd) => cmd.split(".").pop() === "js").forEach((cmd) => {
|
||||
const commandFiles = fs.readdirSync('./commands/' + dir + '/');
|
||||
commandFiles.filter((cmd) => cmd.split('.').pop() === 'js').forEach((cmd) => {
|
||||
cmd = cmd.substring(0, cmd.length - 3);
|
||||
const resp = this.load(cmd, dir);
|
||||
if (resp) {
|
||||
|
@ -46,11 +46,11 @@ class CommandHandler {
|
|||
}
|
||||
});
|
||||
});
|
||||
this.client.logger.info(`Loaded a total of ${this.client.commands.size} commands.`)
|
||||
this.client.logger.info(`Loaded a total of ${this.client.commands.size} commands.`);
|
||||
}
|
||||
|
||||
async unload (name, category) {
|
||||
const path = this.client.path + "/commands/" + category + "/" + name + ".js";
|
||||
const path = this.client.path + '/commands/' + category + '/' + name + '.js';
|
||||
|
||||
let command;
|
||||
|
||||
|
@ -58,27 +58,27 @@ class CommandHandler {
|
|||
command = this.client.commands.get(name);
|
||||
} else if (this.client.aliases.has(name)) {
|
||||
command = this.client.commands.get(this.client.aliases.get(name));
|
||||
};
|
||||
}
|
||||
|
||||
if (!command) {
|
||||
return `\`${name}\` does not exist as a command or an alias.`
|
||||
return `\`${name}\` does not exist as a command or an alias.`;
|
||||
}
|
||||
|
||||
this.client.logger.debug(`Unloading command ${category}/${name}`);
|
||||
|
||||
if (command.shutdown) {
|
||||
await command.shutdown(this.client)
|
||||
await command.shutdown(this.client);
|
||||
}
|
||||
delete require.cache[require.resolve(path)];
|
||||
return false;
|
||||
}
|
||||
|
||||
unloadAll () {
|
||||
const commandDirectories = fs.readdirSync("./commands/");
|
||||
const commandDirectories = fs.readdirSync('./commands/');
|
||||
this.client.logger.debug(`Found ${commandDirectories.length} command directories.`);
|
||||
commandDirectories.forEach((dir) => {
|
||||
const commandFiles = fs.readdirSync("./commands/" + dir + "/");
|
||||
commandFiles.filter((cmd) => cmd.split(".").pop() === "js").forEach((cmd) => {
|
||||
const commandFiles = fs.readdirSync('./commands/' + dir + '/');
|
||||
commandFiles.filter((cmd) => cmd.split('.').pop() === 'js').forEach((cmd) => {
|
||||
cmd = cmd.substring(0, cmd.length - 3);
|
||||
const resp = this.unload(cmd, dir);
|
||||
if (resp) {
|
||||
|
@ -98,7 +98,7 @@ class EventHandler {
|
|||
try {
|
||||
this.client.logger.debug(`Loading event ${name}`);
|
||||
|
||||
const path = this.client.path + "/events/" + name + ".js";
|
||||
const path = this.client.path + '/events/' + name + '.js';
|
||||
const event = new (require(path))(this.client);
|
||||
this.client.on(name, (...args) => event.run(...args));
|
||||
delete require.cache[require.resolve(path)];
|
||||
|
@ -109,14 +109,14 @@ class EventHandler {
|
|||
}
|
||||
}
|
||||
|
||||
unload (name) {
|
||||
unload (name) { //eslint-disable-line no-unused-vars
|
||||
|
||||
}
|
||||
|
||||
loadAll () {
|
||||
const eventFiles = fs.readdirSync(this.client.path + "/events");
|
||||
const eventFiles = fs.readdirSync(this.client.path + '/events');
|
||||
eventFiles.forEach(file => {
|
||||
const name = file.split(".")[0];
|
||||
const name = file.split('.')[0];
|
||||
const resp = this.load(name);
|
||||
|
||||
if (resp) {
|
||||
|
|
Loading…
Reference in a new issue