-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commando rewrite #8
Conversation
This is generally how things are done with Commando.
Commando generates all of this stuff for us.
I mistakenly thought they were normal commands. Kind of jumped the gun there.
Commando provides a ping command which in my opinion achieves the same thing.
I'm not actually sure if this is even possible with Commando anyway, since you need to define all argument that will be passed?
@Elfayer Ready for review IMHO (no rush/pressure). 🙃 |
|
||
module.exports = new Discord.Client() | ||
const { | ||
OWNERS_IDS = '269617876036616193', // Default to @evan#9589 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be process.env.OWNERS_IDS
from .env.example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps... but, well, the intent here was to avoid errors if the .env
file is missing or if the OWNERS_IDS
entry was missing.
It's just a fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const {
OWNERS_IDS = '269617876036616193', // Default to @evan#9589
COMMAND_PREFIX = '!',
} = process.env
Is basically equivalent to this:
let { OWNERS_IDS, COMMAND_PREFIX } = process.env
if (!OWNERS_IDS) OWNERS_IDS = '269617876036616193'
if (!COMMAND_PREFIX) COMMAND_PREFIX = '!'
|
||
import links from '../../../data/documentation' | ||
|
||
module.exports = class DocsDocsCommand extends Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DocsCommand
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command (I've asked this before)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My own personal convention is:
NAME_OF_COMMAND_GROUP + NAME_OF_COMMAND + COMMAND.
- The command name is
docs
. - The command group is
docs
(well by now it's actuallydocumentation
) - So it is
DocsDocsCommand
(should beDocumentationDocsCommand
by now, as said - the group changed).
I think this command should be renamed to Vue anyway and that there should be a command per library.
So we are left with:
- DocumentationVueCommand
- DocumentationVueXCommand
- DocumentationVueRouterCommand
Thoughts? @Elfayer
I think I'm happy with most of this now. I just really wanted to clean up that Job class and so that has been done. But I couldn't help sneak in a small new feature. My apologies, I suppose this is a nightmare to review. |
Updating the README is 100% my final change, unless changes are requested. |
This is not ready for merging nor review. But here it is anyway.Todo
.env
files for configurationdata/
❓ Extract fields from!code
and build dynamically for easier reading + modificationAdmin
) and the channel name (spam
). I think this stuff needs moving to configuration. Perhaps jobs can have their own configuration.Things to take into consideration
Since there is no linting yet, our coding styles may not be entirely in alignment:I had to try very hard to use single quotes (I use double) - I may have missed someI had to try very hard to omit semi-colons (I use them) - I may have accidentally added someI don't put space between function names and parentheses, like you - noticed this one lateThe jobs system hasn't been rewrittenAlso I totally didn't realise what it actually was and removed a bunch of code that will probably be readded. I thought e.g.ban
andwarn
were just regular commands. I should have taken more time to understand the codebase! Your code will be re-added, don't worry.None of this has been tested (yet)I actually haven't even ran it, this is just a first pass 😄Noteworthy changes
.env
files instead of theconfig.json
thing.process.env
.ban-words.txt
) out ofsrc/
and into a new rootdata/
.A note on linting / coding style
I will set up linting soon (adhering to YOUR coding style, don't worry - I'm not that bad 😈).