Skip to content

Commit

Permalink
Update packages and plan our command parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Aug 25, 2018
1 parent 3668433 commit b81eafb
Show file tree
Hide file tree
Showing 2 changed files with 462 additions and 419 deletions.
49 changes: 49 additions & 0 deletions server/bot/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// import { Message } from 'eris'

/* export class Command {
constructor (command) {
this.name = command.name
this.aliases = command.aliases
this.generator = command.generator
this.postGenerator = command.postGenerator // serves as hooks.
// Options.
this.argsRequired = command.opts.argsRequired
this.caseInsensitive = command.opts.caseInsensitive
this.deleteCommand = command.opts.deleteCommand
this.guildOnly = command.opts.guildOnly
this.dmOnly = command.opts.dmOnly
this.description = command.opts.description
this.fullDescription = command.opts.fullDescription
this.usage = command.opts.usage
this.example = command.opts.example
this.hidden = command.opts.hidden // Unimplemented in help.
// Requirements.
this.requirements = command.opts.requirements
// No cooldown implementation.
// No reaction implementation.
}
} */

/* export class CommandParser {
commands: { [name: string]: Command } // eslint-disable-line no-undef
constructor () {
this.commands = {}
}
registerCommand (command) {
this.commands[command.name] = new Command(command)
}
permissionCheck (command: Command, message: Message) {
}
} */
// class CommandParser
// We don't construct.. or maybe we do just a bit.
// Now we add registerCommand
// { name, ...opts, generator, postGenerator } hmm
// now we add onMessage
// Execute permission checker, then generator and postGenerator
// if no command call the other callback in index.ts just cuz yeah
// permission checker
// Now we're literally done. fairly simple.
// go port everything in bot/commands to oldCommands and get forwardporting.. :v
Loading

0 comments on commit b81eafb

Please sign in to comment.