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 { class FSharp extends Language {
constructor() { constructor() {
super('fsharp', { super('fsharp', {
highlight: 'fs', aliases: ['fsharp', 'fs']
aliases: ['fsharp', 'f#', 'fs']
}); });
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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