mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-02 08:41:25 +03:00
update
logger stuff
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
module.exports = {
|
||||
name: 'add',
|
||||
description: 'Add a member to a ticket channel',
|
||||
|
@@ -1,6 +1,6 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
module.exports = {
|
||||
name: 'close',
|
||||
description: 'Close a ticket',
|
||||
|
@@ -1,6 +1,6 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
module.exports = {
|
||||
name: 'example-command',
|
||||
description: 'An example command',
|
||||
|
@@ -1,7 +1,7 @@
|
||||
const Discord = require('discord.js');
|
||||
const { version } = require('../package.json');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
description: 'Displays help menu',
|
||||
@@ -47,7 +47,7 @@ module.exports = {
|
||||
})
|
||||
.catch(error => {
|
||||
// console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
|
||||
console.log(leeks.colors.yellow(leeks.styles.bold(`[WARN] Could not DM help menu to ${message.author.tag}, sending to server channel instead`)));
|
||||
log.warn(`Could not DM help menu to ${message.author.tag}, sending to server channel instead`);
|
||||
message.channel.send(`:x: **Sorry!** There was an error whilst sending the help menu via DMs.`)
|
||||
message.channel.send(data, { split: true })
|
||||
});
|
||||
@@ -92,7 +92,7 @@ module.exports = {
|
||||
})
|
||||
.catch(error => {
|
||||
// console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
|
||||
console.log(leeks.colors.yellow(leeks.styles.bold(`[WARN] Could not DM help menu to ${message.author.tag}, sending to server channel instead`)));
|
||||
log.warn(`Could not DM help menu to ${message.author.tag}, sending to server channel instead`);
|
||||
message.channel.send(`:x: **Sorry!** There was an error whilst sending the help menu via DMs.`)
|
||||
message.channel.send(data, { split: true })
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
// const randomString = require('random-string');
|
||||
module.exports = {
|
||||
name: 'new',
|
||||
@@ -25,13 +25,18 @@ module.exports = {
|
||||
// special: false,
|
||||
// });
|
||||
let id = message.author.id.toString().substr(0,4) + message.author.discriminator;
|
||||
let chan = `ticket-${id}`;
|
||||
|
||||
if(message.guild.channels.some(channel => chan.includes(channel.name))) {
|
||||
if(config.useEmbeds){
|
||||
const err1 = new Discord.RichEmbed()
|
||||
.setColor("#E74C3C")
|
||||
.setDescription(`:x: You already have an open ticket.`)
|
||||
return message.channel.send(err1)
|
||||
} else {
|
||||
message.channel.send(`:x: You already have an open ticket.`)
|
||||
}
|
||||
|
||||
// if(message.guild.channels.some(channel => `ticket-${id}`)) {
|
||||
if(message.guild.channels.some(includes(`ticket-${id}`))) {
|
||||
const err1 = new Discord.RichEmbed()
|
||||
.setColor("#E74C3C")
|
||||
.setDescription(`:x: You already have a ticket open.`)
|
||||
return message.channel.send(err1)
|
||||
};
|
||||
|
||||
message.guild.createChannel(`ticket-${id}`).then(async c => {
|
||||
@@ -79,7 +84,7 @@ module.exports = {
|
||||
// } else {
|
||||
// client.channels.get(config.logChannel).send(`New ticket created by **${message.author.tag} (${message.author.id})**`);
|
||||
// }
|
||||
console.log(leeks.colors.cyan(`${message.author.tag} created a new ticket (#ticket-${id})`))
|
||||
log.info(`${message.author.tag} created a new ticket (#ticket-${id})`)
|
||||
|
||||
// command ends here
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
module.exports = {
|
||||
name: 'ping',
|
||||
description: 'Calculate latency',
|
||||
|
@@ -1,6 +1,6 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
const leeks = require('leeks.js');
|
||||
const log = require(`../handlers/logger.js`);
|
||||
module.exports = {
|
||||
name: 'remove',
|
||||
description: 'Remove a member from a ticket',
|
||||
|
Reference in New Issue
Block a user