Add user-friendly names and show enabled languages
This commit is contained in:
parent
c1842b4df8
commit
3235944d83
24 changed files with 28 additions and 15 deletions
|
@ -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>'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Bash extends Language {
|
||||
constructor() {
|
||||
super('bash', {
|
||||
name: 'Bash',
|
||||
aliases: ['bash', 'sh']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class C extends Language {
|
||||
constructor() {
|
||||
super('c', {
|
||||
name: 'C',
|
||||
aliases: ['c']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Clojure extends Language {
|
||||
constructor() {
|
||||
super('clojure', {
|
||||
name: 'Clojure',
|
||||
aliases: ['clojure', 'clj']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class CPP extends Language {
|
||||
constructor() {
|
||||
super('cpp', {
|
||||
name: 'C++',
|
||||
aliases: ['cpp', 'c++']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class CSharp extends Language {
|
||||
constructor() {
|
||||
super('csharp', {
|
||||
name: 'C#',
|
||||
aliases: ['csharp', 'cs'],
|
||||
options: {
|
||||
e: () => ''
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Elixir extends Language {
|
||||
constructor() {
|
||||
super('elixir', {
|
||||
name: 'Elixir',
|
||||
aliases: ['elixir']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class FSharp extends Language {
|
||||
constructor() {
|
||||
super('fsharp', {
|
||||
name: 'F#',
|
||||
aliases: ['fsharp', 'fs']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Go extends Language {
|
||||
constructor() {
|
||||
super('go', {
|
||||
name: 'Go',
|
||||
aliases: ['golang', 'go']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Haskell extends Language {
|
||||
constructor() {
|
||||
super('haskell', {
|
||||
name: 'Haskell',
|
||||
aliases: ['haskell', 'hs'],
|
||||
options: {
|
||||
e: () => ''
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Java extends Language {
|
||||
constructor() {
|
||||
super('java', {
|
||||
name: 'Java',
|
||||
aliases: ['java']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class JavaScript extends Language {
|
||||
constructor() {
|
||||
super('javascript', {
|
||||
name: 'JavaScript',
|
||||
aliases: ['javascript', 'js'],
|
||||
options: {
|
||||
harmony: () => '',
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Julia extends Language {
|
||||
constructor() {
|
||||
super('julia', {
|
||||
name: 'Julia',
|
||||
aliases: ['julia'],
|
||||
options: {
|
||||
e: () => ''
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Lua extends Language {
|
||||
constructor() {
|
||||
super('lua', {
|
||||
name: 'Lua',
|
||||
aliases: ['lua']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class OCaml extends Language {
|
||||
constructor() {
|
||||
super('ocaml', {
|
||||
name: 'OCaml',
|
||||
aliases: ['ocaml']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Pascal extends Language {
|
||||
constructor() {
|
||||
super('pascal', {
|
||||
name: 'Pascal',
|
||||
aliases: ['pascal', 'pas', 'freepascal']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Perl extends Language {
|
||||
constructor() {
|
||||
super('perl', {
|
||||
name: 'Perl',
|
||||
aliases: ['perl', 'pl']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class PHP extends Language {
|
||||
constructor() {
|
||||
super('php', {
|
||||
name: 'PHP',
|
||||
aliases: ['php']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Prolog extends Language {
|
||||
constructor() {
|
||||
super('prolog', {
|
||||
name: 'Prolog',
|
||||
aliases: ['prolog']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Racket extends Language {
|
||||
constructor() {
|
||||
super('racket', {
|
||||
name: 'Racket',
|
||||
aliases: ['lisp']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Ruby extends Language {
|
||||
constructor() {
|
||||
super('ruby', {
|
||||
name: 'Ruby',
|
||||
aliases: ['ruby', 'rb']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ const Language = require('../struct/Language');
|
|||
class Rust extends Language {
|
||||
constructor() {
|
||||
super('rust', {
|
||||
name: 'Rust',
|
||||
aliases: ['rust', 'rs']
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue