Merge highlight and aliases options

This commit is contained in:
1computer1 2019-03-14 20:29:03 -04:00
parent b3a6858ac0
commit 9a5258d91d
8 changed files with 4 additions and 12 deletions

View file

@ -3,8 +3,7 @@ const Language = require('../struct/Language');
class FSharp extends Language {
constructor() {
super('fsharp', {
highlight: 'fs',
aliases: ['fsharp', 'f#', 'fs']
aliases: ['fsharp', 'fs']
});
}
}

View file

@ -3,8 +3,7 @@ const Language = require('../struct/Language');
class Go extends Language {
constructor() {
super('go', {
highlight: 'go',
aliases: ['go']
aliases: ['golang', 'go']
});
}
}

View file

@ -3,7 +3,6 @@ const Language = require('../struct/Language');
class Haskell extends Language {
constructor() {
super('haskell', {
highlight: 'hs',
aliases: ['haskell', 'hs'],
options: {
e: () => ''

View file

@ -3,7 +3,6 @@ const Language = require('../struct/Language');
class JavaScript extends Language {
constructor() {
super('javascript', {
highlight: 'js',
aliases: ['javascript', 'js'],
options: {
harmony: () => '',

View file

@ -3,8 +3,7 @@ const Language = require('../struct/Language');
class Pascal extends Language {
constructor() {
super('pascal', {
highlight: 'pas',
aliases: ['pascal', 'pas']
aliases: ['pascal', 'pas', 'freepascal']
});
}
}

View file

@ -3,7 +3,6 @@ const Language = require('../struct/Language');
class Python extends Language {
constructor() {
super('python', {
highlight: 'py',
aliases: ['python', 'py'],
loads: ['python3', 'python2'],
options: {

View file

@ -45,7 +45,7 @@ class MessageInvalidListener extends Listener {
}
const invalid = parse.invalid.length ? `Invalid options: ${parse.invalid.join(', ')}\n` : '';
const output = `${invalid}\`\`\`${parse.language.highlight}\n${result}\`\`\``;
const output = `${invalid}\`\`\`${parse.language.aliases[0]}\n${result}\`\`\``;
if (output.length >= 2000) {
const key = await fetch('https://hastebin.com/documents', { method: 'POST', body: result })
.then(res => res.json())

View file

@ -3,14 +3,12 @@ const { AkairoModule } = require('discord-akairo');
class Language extends AkairoModule {
constructor(id, {
category,
highlight,
aliases,
loads = [id],
options = {}
} = {}) {
super(id, { category });
this.highlight = highlight;
this.aliases = aliases;
this.loads = loads;
this.options = options;