Logger & presence activities

This commit is contained in:
Isaac (eartharoid) 2020-10-12 22:45:37 +01:00
parent 93d332f898
commit 5846b88db2
21 changed files with 60 additions and 44 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ user/storage.db
user/transcripts/text/*.txt
user/transcripts/raw/*.log
user/transcripts/raw/entities/*.json
*.code-workspace

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@eartharoid/discordtickets",
"version": "2.0.1",
"version": "2.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -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',

View File

@ -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');

View File

@ -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');

View File

@ -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 = {

View File

@ -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');

View File

@ -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 = {

View File

@ -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',

View File

@ -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',

View File

@ -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',

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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');

View File

@ -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 = {

View File

@ -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',

View File

@ -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();

View File

@ -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',

View File

@ -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');

View File

@ -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');

View File

@ -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,