Alchemy.Cogs.all_commands
You're seeing just the function
all_commands
, go back to Alchemy.Cogs module for more information.
Link to this function
all_commands()
Specs
all_commands() :: map()
Returns a map from command name (string) to the command information.
Each command is either {module, arity, function_name}
, or
{module, arity, function_name, parser}
.
This can be useful for providing some kind of help command, or telling a user if a command is defined, e.g. :
Cogs.def iscommand(maybe) do
case Cogs.all_commands()[maybe] do
nil -> Cogs.say "#{maybe} is not a command"
_ -> Cogs.say "#{maybe} is a command"
end
end