Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Added options and flags to command filter #552
Conversation
Added options and flags. Options will consume both keyword and value right next to, flags will just consume the keyword itself. `message.command` is now a dict : the "old" list can be found in `message.command["raw"]`. Options, if found, will be inserted in the dict with the name they were registered with. Flags will be added to a list in `message.command["flags"]`. The remaining command can be accessed as a list in `message.command["cmd"]` or as one joined string in `message.command["arg"]`. Note that neither of these will be present if options and flags will consume the command list completely.
I added a way to define options and flags to look for in the command text. Having just a list of words wasn't enough for complex commands.
I made it keep the old
message.commandlist for compatibility, but having it as one dict would be nicer in my opinion.Basically, now you can do