-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e41a42e
commit 9e95111
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
global.toID = function (text) { | ||
if (typeof text === 'string') return text.toLowerCase().replace(/[^a-z0-9]/g, ''); | ||
} | ||
|
||
|
||
global.config = require('../Configs/config'); | ||
global.emotes = require('../Configs/emotes') | ||
global.filters = require('../Configs/filters') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const chalk = require('chalk'); | ||
const util = require('util'); | ||
|
||
const append = (m) => { | ||
const message = `[${new Date().toLocaleDateString()}] | ${m}`; | ||
return typeof message === "string" ? message : util.inspect(message); | ||
} | ||
|
||
global.logger = { | ||
log: message => { | ||
console.log(chalk.whiteBright(append((message)))); | ||
}, | ||
|
||
error: message => { | ||
console.log(chalk.redBright(append((message)))); | ||
}, | ||
|
||
warn: message => { | ||
console.log(chalk.magentaBright(append((message)))); | ||
}, | ||
|
||
info: message => { | ||
console.log(chalk.blueBright(append((message)))); | ||
}, | ||
|
||
success: message => { | ||
console.log(chalk.greenBright(append((message)))); | ||
}, | ||
|
||
debug: message => { | ||
console.log(chalk.yellowBright(append((message)))); | ||
}, | ||
}; | ||
|
||
module.exports.logger = logger; |