|
@@ -52,6 +52,20 @@ class Rollbot(Generic[RawMsg]):
|
|
|
return
|
|
|
|
|
|
command = self.command_config.aliases.get(message.command.name, message.command.name)
|
|
|
+
|
|
|
+ if command == "help":
|
|
|
+ args = message.command.args.split(maxsplit=1)
|
|
|
+ if len(args) == 0:
|
|
|
+ help_msg = "Use this command to look up the help info of another command, try !help roll for example!"
|
|
|
+ else:
|
|
|
+ cmd = self.command_config.commands.get(args[0], None)
|
|
|
+ if cmd is None or cmd.__doc__ is None:
|
|
|
+ help_msg = "Sorry! I don't have any explanation of that command"
|
|
|
+ else:
|
|
|
+ help_msg = cmd.__doc__.strip()
|
|
|
+ await self.respond(Response.from_message(message, help_msg))
|
|
|
+ return
|
|
|
+
|
|
|
res = self.command_config.call_and_response.get(command, None)
|
|
|
if res is not None:
|
|
|
await self.respond(Response.from_message(message, res))
|