Add some comments

master
Miikka Virtanen 2016-12-06 02:31:42 +02:00
parent 145a3bee15
commit 041c3fe855
1 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,10 @@ function saveBlocked() {
fs.writeFileSync(blockFile, JSON.stringify(blocked, null, 4)); fs.writeFileSync(blockFile, JSON.stringify(blocked, null, 4));
} }
/*
* MODMAIL LOG UTILITY FUNCTIONS
*/
function getLogFileInfo(logfile) { function getLogFileInfo(logfile) {
const match = logfile.match(logFileFormatRegex); const match = logfile.match(logFileFormatRegex);
if (! match) return null; if (! match) return null;
@ -104,6 +108,10 @@ function findLogFilesByUserId(userId) {
}); });
} }
/*
* MAIN FUNCTIONALITY
*/
bot.on('ready', () => { bot.on('ready', () => {
modMailGuild = bot.guilds.find(g => g.id === config.mailGuildId); modMailGuild = bot.guilds.find(g => g.id === config.mailGuildId);
@ -319,7 +327,10 @@ bot.registerCommand('logs', (msg, args) => {
bot.connect(); bot.connect();
// Server for serving logs /*
* MODMAIL LOG SERVER
*/
const server = http.createServer((req, res) => { const server = http.createServer((req, res) => {
const parsedUrl = url.parse(`http://${req.url}`); const parsedUrl = url.parse(`http://${req.url}`);