From 27a9a4764d4caecd79a24bfb68096580032e8485 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 20 Jan 2014 11:15:30 +0100 Subject: [PATCH] Document commands handling on the plugin side. --- develop/events.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/develop/events.rst b/develop/events.rst index feb5f8d..b1a0591 100644 --- a/develop/events.rst +++ b/develop/events.rst @@ -7,6 +7,10 @@ events catchable via those methods (other events include :ref:`configuration hooks ` and :ref:`HTTP server callbacks `) +All methods here are defined in ``supybot-callbacks-plugin``. You may +override them if you need, but make sure you call the parent's one +unless you actually don't want to do it. + Commands and numerics ===================== @@ -23,3 +27,21 @@ To get a list of all possible messages, check IRC RFCs. Commands handling ================= + +.. note:: + I wrote this section with the little knowledge I have of the + commands handling (all I know comes from hacks I made to write + the Aka plugin), so keep in mind some informations might + be wrong. + As for all the documentation, feel free to contact me to + correct/enhance it. + +* isCommandMethod takes a command name as a string (which may contain + spaces) and returns a boolean telling if the plugin provides this command. +* listCommands returns a list of command names as strings (which may + contain spaces) +* getCommand takes a potential command name as a list of strings, and + returns a truncated list corresponding to the name of a command provided + by the plugin. If no command match, it returns an empty list. +* getCommandMethod takes a command name as a list of strings and + returns the corresponding method/function.