mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 08:13:09 +02:00
config
This commit is contained in:
parent
c554bd5438
commit
2c5699d946
@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ module.exports = {
|
|||||||
aliases: ['none'],
|
aliases: ['none'],
|
||||||
example: 'add @member to #ticket-23',
|
example: 'add @member to #ticket-23',
|
||||||
args: true,
|
args: true,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const archive = require('../modules/archive');
|
const archive = require('../modules/archive');
|
||||||
|
|
||||||
@ -20,7 +19,7 @@ module.exports = {
|
|||||||
aliases: ['none'],
|
aliases: ['none'],
|
||||||
example: 'close #ticket-17',
|
example: 'close #ticket-17',
|
||||||
args: false,
|
args: false,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'help',
|
name: 'help',
|
||||||
@ -18,7 +17,7 @@ module.exports = {
|
|||||||
aliases: ['command', 'commands'],
|
aliases: ['command', 'commands'],
|
||||||
example: 'help new',
|
example: 'help new',
|
||||||
args: false,
|
args: false,
|
||||||
execute(client, message, args) {
|
execute(client, message, args, {config}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ const ChildLogger = require('leekslazylogger').ChildLogger;
|
|||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'new',
|
name: 'new',
|
||||||
@ -19,7 +18,7 @@ module.exports = {
|
|||||||
aliases: ['ticket', 'open'],
|
aliases: ['ticket', 'open'],
|
||||||
example: 'new my server won\'t start',
|
example: 'new my server won\'t start',
|
||||||
args: false,
|
args: false,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'panel',
|
name: 'panel',
|
||||||
@ -19,7 +18,7 @@ module.exports = {
|
|||||||
example: '',
|
example: '',
|
||||||
args: false,
|
args: false,
|
||||||
permission: 'MANAGE_SERVER',
|
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);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ module.exports = {
|
|||||||
aliases: ['none'],
|
aliases: ['none'],
|
||||||
example: 'remove @member from #ticket-23',
|
example: 'remove @member from #ticket-23',
|
||||||
args: true,
|
args: true,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -6,10 +6,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
|
||||||
const log = new ChildLogger();
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'stats',
|
name: 'stats',
|
||||||
@ -18,7 +15,7 @@ module.exports = {
|
|||||||
aliases: ['data', 'statistics'],
|
aliases: ['data', 'statistics'],
|
||||||
example: '',
|
example: '',
|
||||||
args: false,
|
args: false,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'tickets',
|
name: 'tickets',
|
||||||
@ -17,7 +16,7 @@ module.exports = {
|
|||||||
aliases: ['list'],
|
aliases: ['list'],
|
||||||
example: '',
|
example: '',
|
||||||
args: false,
|
args: false,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'topic',
|
name: 'topic',
|
||||||
@ -16,7 +15,7 @@ module.exports = {
|
|||||||
aliases: ['edit'],
|
aliases: ['edit'],
|
||||||
example: 'topic need help error',
|
example: 'topic need help error',
|
||||||
args: true,
|
args: true,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ const fs = require('fs');
|
|||||||
const {
|
const {
|
||||||
MessageEmbed
|
MessageEmbed
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'transcript',
|
name: 'transcript',
|
||||||
@ -19,7 +18,7 @@ module.exports = {
|
|||||||
aliases: ['archive', 'download'],
|
aliases: ['archive', 'download'],
|
||||||
example: 'transcript 57',
|
example: 'transcript 57',
|
||||||
args: true,
|
args: true,
|
||||||
async execute(client, message, args, Ticket) {
|
async execute(client, message, args, {config, Ticket}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
const guild = client.guilds.cache.get(config.guild);
|
||||||
const id = args[0];
|
const id = args[0];
|
||||||
|
@ -9,12 +9,11 @@
|
|||||||
const { Collection, MessageEmbed } = require('discord.js');
|
const { Collection, MessageEmbed } = require('discord.js');
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const archive = require('../modules/archive');
|
const archive = require('../modules/archive');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'message',
|
event: 'message',
|
||||||
async execute(client, [message], {Ticket, Setting}) {
|
async execute(client, [message], {config, Ticket, Setting}) {
|
||||||
|
|
||||||
const guild = client.guilds.cache.get(config.guild);
|
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);
|
setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);
|
||||||
|
|
||||||
try {
|
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`);
|
log.console(`${message.author.tag} used the '${command.name}' command`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.warn(`An error occurred whilst executing the '${command.name}' command`);
|
log.warn(`An error occurred whilst executing the '${command.name}' command`);
|
||||||
|
@ -8,12 +8,11 @@
|
|||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'messageDelete',
|
event: 'messageDelete',
|
||||||
async execute(client, [message], {Ticket}) {
|
async execute(client, [message], {config, Ticket}) {
|
||||||
|
|
||||||
if(!config.transcripts.web.enabled) return;
|
if(!config.transcripts.web.enabled) return;
|
||||||
|
|
||||||
|
@ -9,12 +9,11 @@
|
|||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'messageReactionAdd',
|
event: 'messageReactionAdd',
|
||||||
async execute(client, [r, u], {Ticket, Setting}) {
|
async execute(client, [r, u], {config, Ticket, Setting}) {
|
||||||
|
|
||||||
if (r.partial)
|
if (r.partial)
|
||||||
try {
|
try {
|
||||||
|
@ -6,16 +6,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const Discord = require('discord.js');
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const ChildLogger = require('leekslazylogger').ChildLogger;
|
||||||
const log = new ChildLogger();
|
const log = new ChildLogger();
|
||||||
const config = require('../../user/' + require('../').config);
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const dtf = require('@eartharoid/dtf');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'messageUpdate',
|
event: 'messageUpdate',
|
||||||
async execute(client, [o, n], {Ticket}) {
|
async execute(client, [o, n], {config, Ticket}) {
|
||||||
|
|
||||||
if(!config.transcripts.web.enabled) return;
|
if(!config.transcripts.web.enabled) return;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ for (const file of events) {
|
|||||||
const event = require(`./events/${file}`);
|
const event = require(`./events/${file}`);
|
||||||
client.events.set(event.event, event);
|
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, 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`));
|
log.console(log.format(`> Loaded &7${event.event}&f event`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
|
||||||
const log = new ChildLogger();
|
|
||||||
const lineReader = require('line-reader');
|
const lineReader = require('line-reader');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const dtf = require('@eartharoid/dtf');
|
const dtf = require('@eartharoid/dtf');
|
||||||
|
Loading…
Reference in New Issue
Block a user