diff --git a/.gitignore b/.gitignore index 3ed4583..e800978 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ user/dev.config.js user/storage.db user/transcripts/text/*.txt user/transcripts/raw/*.log -user/transcripts/raw/entities/*.json \ No newline at end of file +user/transcripts/raw/entities/*.json +*.code-workspace diff --git a/package-lock.json b/package-lock.json index 942e60f..4980d38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@eartharoid/discordtickets", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/commands/add.js b/src/commands/add.js index 4024851..45df22a 100644 --- a/src/commands/add.js +++ b/src/commands/add.js @@ -7,8 +7,8 @@ */ const { MessageEmbed } = require('discord.js'); -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); module.exports = { name: 'add', diff --git a/src/commands/close.js b/src/commands/close.js index f63d5bf..ddd0f7e 100644 --- a/src/commands/close.js +++ b/src/commands/close.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const { MessageEmbed } = require('discord.js'); diff --git a/src/commands/delete.js b/src/commands/delete.js index 1d565a4..0e1966e 100644 --- a/src/commands/delete.js +++ b/src/commands/delete.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const { MessageEmbed } = require('discord.js'); diff --git a/src/commands/help.js b/src/commands/help.js index 9d06c38..b2c3997 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const { MessageEmbed } = require('discord.js'); module.exports = { diff --git a/src/commands/new.js b/src/commands/new.js index 76ce804..544cd5c 100644 --- a/src/commands/new.js +++ b/src/commands/new.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const { MessageEmbed } = require('discord.js'); const fs = require('fs'); diff --git a/src/commands/panel.js b/src/commands/panel.js index 9bf6d93..622f6a7 100644 --- a/src/commands/panel.js +++ b/src/commands/panel.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const { MessageEmbed } = require('discord.js'); module.exports = { diff --git a/src/commands/remove.js b/src/commands/remove.js index 472daad..2ad11c3 100644 --- a/src/commands/remove.js +++ b/src/commands/remove.js @@ -7,8 +7,8 @@ */ const { MessageEmbed } = require('discord.js'); -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); module.exports = { name: 'remove', diff --git a/src/events/debug.js b/src/events/debug.js index 1d085f4..584e856 100644 --- a/src/events/debug.js +++ b/src/events/debug.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); module.exports = { event: 'debug', diff --git a/src/events/error.js b/src/events/error.js index f1c89de..4147598 100644 --- a/src/events/error.js +++ b/src/events/error.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); module.exports = { event: 'error', diff --git a/src/events/message.js b/src/events/message.js index 55e2040..344032f 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -7,8 +7,8 @@ */ const { Collection, MessageEmbed } = require('discord.js'); -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const archive = require('../modules/archive'); module.exports = { diff --git a/src/events/messageDelete.js b/src/events/messageDelete.js index cc304e7..e0a0b02 100644 --- a/src/events/messageDelete.js +++ b/src/events/messageDelete.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const fs = require('fs'); module.exports = { diff --git a/src/events/messageReactionAdd.js b/src/events/messageReactionAdd.js index 945a197..3817f87 100644 --- a/src/events/messageReactionAdd.js +++ b/src/events/messageReactionAdd.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const { MessageEmbed } = require('discord.js'); const fs = require('fs'); diff --git a/src/events/messageUpdate.js b/src/events/messageUpdate.js index 598b651..f8d6f04 100644 --- a/src/events/messageUpdate.js +++ b/src/events/messageUpdate.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const fs = require('fs'); module.exports = { diff --git a/src/events/rateLimit.js b/src/events/rateLimit.js index b17e8fc..afb50fc 100644 --- a/src/events/rateLimit.js +++ b/src/events/rateLimit.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); module.exports = { event: 'rateLimit', diff --git a/src/events/ready.js b/src/events/ready.js index 7203ebd..32f1828 100644 --- a/src/events/ready.js +++ b/src/events/ready.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const config = require('../../user/' + require('../').config); module.exports = { @@ -16,14 +16,16 @@ module.exports = { log.success(`Authenticated as ${client.user.tag}`); const updatePresence = () => { - let num = Math.floor(Math.random() * config.activities.length); + const presence = config.presences[Math.floor(Math.random() * config.presences.length)]; + let activity = presence.activity + config.append_presence; + activity = activity.replace(/%s/g, config.prefix); client.user.setPresence({ activity: { - name: config.activities[num] + ` | ${config.prefix}help`, - type: config.activity_types[num] + name: activity, + type: presence.type.toUpperCase() } }).catch(log.error); - log.debug(`Updated presence: ${config.activity_types[num]} ${config.activities[num]}`); + log.debug(`Updated presence: ${activity} ${presence.type}`); }; updatePresence(); diff --git a/src/events/warn.js b/src/events/warn.js index 27e6c1b..2205b04 100644 --- a/src/events/warn.js +++ b/src/events/warn.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); module.exports = { event: 'warn', diff --git a/src/modules/archive.js b/src/modules/archive.js index f8f1c16..c50739c 100644 --- a/src/modules/archive.js +++ b/src/modules/archive.js @@ -7,8 +7,8 @@ */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const lineReader = require('line-reader'); const fs = require('fs'); const dtf = require('@eartharoid/dtf'); diff --git a/src/modules/updater.js b/src/modules/updater.js index ee91645..ce472c8 100644 --- a/src/modules/updater.js +++ b/src/modules/updater.js @@ -6,8 +6,8 @@ * */ -const ChildLogger = require('leekslazylogger').ChildLogger; -const log = new ChildLogger(); +const Logger = require('leekslazylogger'); +const log = new Logger(); const fetch = require('node-fetch'); const config = require('../../user/' + require('../').config); let {version} = require('../../package.json'); diff --git a/user/config.js b/user/config.js index d14c2b2..21c5d55 100644 --- a/user/config.js +++ b/user/config.js @@ -29,8 +29,21 @@ module.exports = { prefix: '-', name: 'DiscordTickets', - activities: ['-new', 'with tickets', 'for new tickets'], - activity_types: ['PLAYING', 'PLAYING', 'WATCHING'], // Available: PLAYING / LISTENING / WATCHING / STREAMING + presences: [ + { + activity: '%snew', + type: 'PLAYING' + }, + { + activity: 'with tickets', + type: 'PLAYING' + }, + { + activity: 'for new tickets', + type: 'WATCHING' + } + ], + append_presence: ' | %shelp', colour: '#009999', err_colour: 'RED', cooldown: 3,