v2 rewrite with discord.js@v12 support. Now with SQLite or MySQL storage.

Code is at least 80% less bad.
This commit is contained in:
Isaac (eartharoid)
2020-08-12 23:02:33 +01:00
parent c77f38f209
commit 8431b2d241
44 changed files with 4072 additions and 802 deletions

22
src/utils/archive.js Normal file
View File

@@ -0,0 +1,22 @@
/**
*
* @name DiscordTickets
* @author eartharoid <contact@eartharoid.me>
* @license GNU-GPLv3
*
*/
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
module.exports.create = (client, channel) => {
};
module.exports.addUser = (client, channel, user) => {
};
module.exports.addMessage = (client, channel, message) => {
};

31
src/utils/banner.js Normal file
View File

@@ -0,0 +1,31 @@
/**
*
* @name DiscordTickets
* @author eartharoid <contact@eartharoid.me>
* @license GNU-GPLv3
*
*/
const { version, homepage } = require('../../package.json');
module.exports = (leeks) => {
console.log(leeks.colours.cyan(`
######## #### ###### ###### ####### ######## ########
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ##
## ## ## ###### ## ## ## ######## ## ##
## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
######## #### ###### ###### ####### ## ## ########
######## #### ###### ## ## ######## ######## ######
## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ##
## ## ## ##### ###### ## ######
## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ##
## #### ###### ## ## ######## ## ######
`));
console.log(leeks.colours.cyanBright(`DiscordTickets bot v${version} by eartharoid`));
console.log(leeks.colours.cyanBright(homepage));
console.log('\n\n');
};

31
src/utils/updater.js Normal file
View File

@@ -0,0 +1,31 @@
/**
*
* @name DiscordTickets
* @author eartharoid <contact@eartharoid.me>
* @license GNU-GPLv3
*
*/
const ChildLogger = require('leekslazylogger').ChildLogger;
const log = new ChildLogger();
const fetch = require('node-fetch');
const config = require('../../user/config');
let {version} = require('../../package.json');
version = 'v' + version;
module.exports = () => {
if(!config.updater)
return;
fetch('https://api.github.com/repos/eartharoid/DiscordTickets/releases')
.then(res => res.json())
.then(json => {
const update = json[0];
if (version !== update.tag_name) {
log.notice('There is an update available for Discord Tickets');
log.info(`Download "&f${update.name}&3" from &6https://github.com/eartharoid/DiscordTickets/releases/`);
log.notice(`You currently have ${version}; The latest is ${update.tag_name}`);
}
});
};