Skip to content

Implement !help #35

@palasso

Description

@palasso

We'd have help to print either all help messages when called as !help or print only one message when called as e.g. !help bacon.

It would be easy to add an additional dimension to cmdlist with a string that's supposed to appear when invoking help. We'd change self.cmdlist[out['botcmd']](out,self.usrlist) to self.cmdlist[out['botcmd']][0](out,self.usrlist).

But if we want help to print dynamically help messages for commands then maybe we should make each command return its help message. This would be helpful later with the commands module. For example we'd make bacon(info,usrs,mode) and when help is invoked it would call the method in help mode and do a return of a string (the following commands wouldn't run).
Let's take an example. Let's say we only need 2 modes for a command (it runs the command or it gives command's help as provided by developer of the command). Then instead of mode we'd have a boolean needshelp and the method would be:

bacon(info,usrs,needshelp=False):
    if(needshelp): return("It gives bacon to users")
    ...

We could call this command in help as bacon(info,usrs,True) and get the help for it.
Of course we'd do this for all commands (so we'd list them in an array) or just for this one if we're in the !help bacon case.

Any suggestions? It would be better to decide on the general direction of this before writing code.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions