Add languages configuration

This commit is contained in:
1computer1 2019-03-13 01:04:18 -04:00
parent 1cc481c7af
commit db79b4b026
2 changed files with 10 additions and 3 deletions

View file

@ -1,4 +1,10 @@
{
"owner": "123",
"token": "123"
"owner": "Discord ID of the bot owner(s)",
"token": "Bot token",
"languages": [
"Language whitelist, e.g.",
"haskell",
"python",
"Leave empty to enable all languages"
]
}

View file

@ -11,7 +11,8 @@ class LanguageHandler extends AkairoHandler {
classToHandle = Language,
extensions = ['.js', '.ts'],
automateCategories,
loadFilter
loadFilter = filepath =>
!this.client.config.languages.length || this.client.config.languages.includes(path.parse(filepath).name)
}) {
super(client, {
directory,