This commit is contained in:
Isaac (eartharoid) 2020-08-23 23:15:39 +01:00
parent c554bd5438
commit 2c5699d946
16 changed files with 16 additions and 36 deletions

View File

@ -7,7 +7,6 @@
*/
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
@ -18,7 +17,7 @@ module.exports = {
aliases: ['none'],
example: 'add @member to #ticket-23',
args: true,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -9,7 +9,6 @@
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
const fs = require('fs');
const archive = require('../modules/archive');
@ -20,7 +19,7 @@ module.exports = {
aliases: ['none'],
example: 'close #ticket-17',
args: false,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -9,7 +9,6 @@
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'help',
@ -18,7 +17,7 @@ module.exports = {
aliases: ['command', 'commands'],
example: 'help new',
args: false,
execute(client, message, args) {
execute(client, message, args, {config}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -10,7 +10,6 @@ const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const { MessageEmbed } = require('discord.js');
const fs = require('fs');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'new',
@ -19,7 +18,7 @@ module.exports = {
aliases: ['ticket', 'open'],
example: 'new my server won\'t start',
args: false,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -9,7 +9,6 @@
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'panel',
@ -19,7 +18,7 @@ module.exports = {
example: '',
args: false,
permission: 'MANAGE_SERVER',
async execute(client, message, args, Ticket, Setting) {
async execute(client, message, args, {config, Setting}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -7,7 +7,6 @@
*/
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
@ -18,7 +17,7 @@ module.exports = {
aliases: ['none'],
example: 'remove @member from #ticket-23',
args: true,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -6,10 +6,7 @@
*
*/
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'stats',
@ -18,7 +15,7 @@ module.exports = {
aliases: ['data', 'statistics'],
example: '',
args: false,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -8,7 +8,6 @@
const { MessageEmbed } = require('discord.js');
const fs = require('fs');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'tickets',
@ -17,7 +16,7 @@ module.exports = {
aliases: ['list'],
example: '',
args: false,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -7,7 +7,6 @@
*/
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'topic',
@ -16,7 +15,7 @@ module.exports = {
aliases: ['edit'],
example: 'topic need help error',
args: true,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);

View File

@ -10,7 +10,6 @@ const fs = require('fs');
const {
MessageEmbed
} = require('discord.js');
const config = require('../../user/' + require('../').config);
module.exports = {
name: 'transcript',
@ -19,7 +18,7 @@ module.exports = {
aliases: ['archive', 'download'],
example: 'transcript 57',
args: true,
async execute(client, message, args, Ticket) {
async execute(client, message, args, {config, Ticket}) {
const guild = client.guilds.cache.get(config.guild);
const id = args[0];

View File

@ -9,12 +9,11 @@
const { Collection, MessageEmbed } = require('discord.js');
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const config = require('../../user/' + require('../').config);
const archive = require('../modules/archive');
module.exports = {
event: 'message',
async execute(client, [message], {Ticket, Setting}) {
async execute(client, [message], {config, Ticket, Setting}) {
const guild = client.guilds.cache.get(config.guild);
@ -101,7 +100,7 @@ Type \`${config.prefix}new\` on the server to create a new ticket.`);
setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);
try {
command.execute(client, message, args, Ticket, Setting);
command.execute(client, message, args, {config, Ticket, Setting});
log.console(`${message.author.tag} used the '${command.name}' command`);
} catch (error) {
log.warn(`An error occurred whilst executing the '${command.name}' command`);

View File

@ -8,12 +8,11 @@
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const config = require('../../user/' + require('../').config);
const fs = require('fs');
module.exports = {
event: 'messageDelete',
async execute(client, [message], {Ticket}) {
async execute(client, [message], {config, Ticket}) {
if(!config.transcripts.web.enabled) return;

View File

@ -9,12 +9,11 @@
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const { MessageEmbed } = require('discord.js');
const config = require('../../user/' + require('../').config);
const fs = require('fs');
module.exports = {
event: 'messageReactionAdd',
async execute(client, [r, u], {Ticket, Setting}) {
async execute(client, [r, u], {config, Ticket, Setting}) {
if (r.partial)
try {

View File

@ -6,16 +6,13 @@
*
*/
const Discord = require('discord.js');
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const config = require('../../user/' + require('../').config);
const fs = require('fs');
const dtf = require('@eartharoid/dtf');
module.exports = {
event: 'messageUpdate',
async execute(client, [o, n], {Ticket}) {
async execute(client, [o, n], {config, Ticket}) {
if(!config.transcripts.web.enabled) return;

View File

@ -95,7 +95,7 @@ for (const file of events) {
const event = require(`./events/${file}`);
client.events.set(event.event, event);
// client.on(event.event, e => client.events.get(event.event).execute(client, e, Ticket, Setting));
client.on(event.event, (e1, e2) => client.events.get(event.event).execute(client, [e1, e2], {Ticket, Setting}));
client.on(event.event, (e1, e2) => client.events.get(event.event).execute(client, [e1, e2], {config, Ticket, Setting}));
log.console(log.format(`> Loaded &7${event.event}&f event`));
}

View File

@ -6,8 +6,6 @@
*
*/
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const lineReader = require('line-reader');
const fs = require('fs');
const dtf = require('@eartharoid/dtf');