Add user-friendly names and show enabled languages

This commit is contained in:
1computer1 2019-05-16 20:51:46 -04:00
parent c1842b4df8
commit 3235944d83
24 changed files with 28 additions and 15 deletions

View file

@ -11,24 +11,13 @@ class HelpCommand extends Command {
exec(message) {
return message.util.send([
'**Usage:**',
'Put a `>` before a code block with a language or an inline code block that has a language to execute it.',
'Put a `>` before a code block or inline codeblock that starts with a language code to execute it.',
'You can add options, separated by semicolons, after the `>`.',
'',
'**Examples:**',
'```',
'>`\u200B``py',
'print(\'Hello world!\');',
'`\u200B``',
'**Enabled Languages (Name: Language Codes):**',
...this.client.languageHandler.modules.map(lang => `${lang.name}: \`${lang.aliases.join('`, `')}\``),
'',
'>`hs main = print (1 + 1)`',
'',
'>e; harmony`\u200B``js',
'class Foo { bar = 1; }',
'new Foo().bar;',
'`\u200B``',
'```',
'',
'Read the readme for supported languages and options: <https://github.com/1Computer1/comp_iler>'
'See the readme for usage examples, supported languages, and options: <https://github.com/1Computer1/comp_iler>'
]);
}
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Bash extends Language {
constructor() {
super('bash', {
name: 'Bash',
aliases: ['bash', 'sh']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class C extends Language {
constructor() {
super('c', {
name: 'C',
aliases: ['c']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Clojure extends Language {
constructor() {
super('clojure', {
name: 'Clojure',
aliases: ['clojure', 'clj']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class CPP extends Language {
constructor() {
super('cpp', {
name: 'C++',
aliases: ['cpp', 'c++']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class CSharp extends Language {
constructor() {
super('csharp', {
name: 'C#',
aliases: ['csharp', 'cs'],
options: {
e: () => ''

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Elixir extends Language {
constructor() {
super('elixir', {
name: 'Elixir',
aliases: ['elixir']
});
}

View file

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

View file

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

View file

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

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Java extends Language {
constructor() {
super('java', {
name: 'Java',
aliases: ['java']
});
}

View file

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

View file

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

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Lua extends Language {
constructor() {
super('lua', {
name: 'Lua',
aliases: ['lua']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class OCaml extends Language {
constructor() {
super('ocaml', {
name: 'OCaml',
aliases: ['ocaml']
});
}

View file

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

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Perl extends Language {
constructor() {
super('perl', {
name: 'Perl',
aliases: ['perl', 'pl']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class PHP extends Language {
constructor() {
super('php', {
name: 'PHP',
aliases: ['php']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Prolog extends Language {
constructor() {
super('prolog', {
name: 'Prolog',
aliases: ['prolog']
});
}

View file

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

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Racket extends Language {
constructor() {
super('racket', {
name: 'Racket',
aliases: ['lisp']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Ruby extends Language {
constructor() {
super('ruby', {
name: 'Ruby',
aliases: ['ruby', 'rb']
});
}

View file

@ -3,6 +3,7 @@ const Language = require('../struct/Language');
class Rust extends Language {
constructor() {
super('rust', {
name: 'Rust',
aliases: ['rust', 'rs']
});
}

View file

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