From a74fe9bf0814e6f86f059be81e0867ac1945a820 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 2 Jul 2018 00:47:30 -0700 Subject: [PATCH] writing-plugins: refer to the services API guide for utils.add_cmd features --- docs/technical/writing-plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/technical/writing-plugins.md b/docs/technical/writing-plugins.md index 0015aa3..ae92367 100644 --- a/docs/technical/writing-plugins.md +++ b/docs/technical/writing-plugins.md @@ -41,7 +41,8 @@ Commands are registered by calling `utils.add_cmd()` with one or two arguments. - `utils.add_cmd(testcommand, "hello")` registers a function named `testcommand` as the command handler for `hello` (i.e. `/msg PyLink hello`) - `utils.add_cmd(testcommand)` registers a function named `testcommand` as the command handler for `testcommand`. -Decorator syntax (`@utils.add_cmd`) can also be used for the second case. +`utils.add_cmd(...)` also takes some keyword arguments, described in the [services API guide](services-api.md#service-bots-and-commands) (replace `myservice.add_cmd` with `utils.add_cmd`). Decorator syntax (`@utils.add_cmd`) can also be used for the second example above. + Each command handler function takes 3 arguments: `irc, source, args`. - **irc**: The network object where the command was called.