mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 09:23:07 +02:00
Logger & presence activities
This commit is contained in:
parent
93d332f898
commit
5846b88db2
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,4 +5,5 @@ user/dev.config.js
|
|||||||
user/storage.db
|
user/storage.db
|
||||||
user/transcripts/text/*.txt
|
user/transcripts/text/*.txt
|
||||||
user/transcripts/raw/*.log
|
user/transcripts/raw/*.log
|
||||||
user/transcripts/raw/entities/*.json
|
user/transcripts/raw/entities/*.json
|
||||||
|
*.code-workspace
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@eartharoid/discordtickets",
|
"name": "@eartharoid/discordtickets",
|
||||||
"version": "2.0.1",
|
"version": "2.0.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'add',
|
name: 'add',
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const {
|
const {
|
||||||
MessageEmbed
|
MessageEmbed
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const {
|
const {
|
||||||
MessageEmbed
|
MessageEmbed
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'remove',
|
name: 'remove',
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'debug',
|
event: 'debug',
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'error',
|
event: 'error',
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { Collection, MessageEmbed } = require('discord.js');
|
const { Collection, MessageEmbed } = require('discord.js');
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const archive = require('../modules/archive');
|
const archive = require('../modules/archive');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'rateLimit',
|
event: 'rateLimit',
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const config = require('../../user/' + require('../').config);
|
const config = require('../../user/' + require('../').config);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@ -16,14 +16,16 @@ module.exports = {
|
|||||||
log.success(`Authenticated as ${client.user.tag}`);
|
log.success(`Authenticated as ${client.user.tag}`);
|
||||||
|
|
||||||
const updatePresence = () => {
|
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({
|
client.user.setPresence({
|
||||||
activity: {
|
activity: {
|
||||||
name: config.activities[num] + ` | ${config.prefix}help`,
|
name: activity,
|
||||||
type: config.activity_types[num]
|
type: presence.type.toUpperCase()
|
||||||
}
|
}
|
||||||
}).catch(log.error);
|
}).catch(log.error);
|
||||||
log.debug(`Updated presence: ${config.activity_types[num]} ${config.activities[num]}`);
|
log.debug(`Updated presence: ${activity} ${presence.type}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
updatePresence();
|
updatePresence();
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
event: 'warn',
|
event: 'warn',
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
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');
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ChildLogger = require('leekslazylogger').ChildLogger;
|
const Logger = require('leekslazylogger');
|
||||||
const log = new ChildLogger();
|
const log = new Logger();
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
const config = require('../../user/' + require('../').config);
|
const config = require('../../user/' + require('../').config);
|
||||||
let {version} = require('../../package.json');
|
let {version} = require('../../package.json');
|
||||||
|
@ -29,8 +29,21 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
prefix: '-',
|
prefix: '-',
|
||||||
name: 'DiscordTickets',
|
name: 'DiscordTickets',
|
||||||
activities: ['-new', 'with tickets', 'for new tickets'],
|
presences: [
|
||||||
activity_types: ['PLAYING', 'PLAYING', 'WATCHING'], // Available: PLAYING / LISTENING / WATCHING / STREAMING
|
{
|
||||||
|
activity: '%snew',
|
||||||
|
type: 'PLAYING'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
activity: 'with tickets',
|
||||||
|
type: 'PLAYING'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
activity: 'for new tickets',
|
||||||
|
type: 'WATCHING'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
append_presence: ' | %shelp',
|
||||||
colour: '#009999',
|
colour: '#009999',
|
||||||
err_colour: 'RED',
|
err_colour: 'RED',
|
||||||
cooldown: 3,
|
cooldown: 3,
|
||||||
|
Loading…
Reference in New Issue
Block a user