summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-09 14:51:48 +0100
committermathieui <mathieui@mathieui.net>2011-11-09 14:51:48 +0100
commit103ddd762d7ed98ce263604de9979002e3ca47b3 (patch)
treea281269076dcf2c41e0f2061adbabf137ca584ad /doc
parentaee7baab245e7edabc960e52f6062393197b6a38 (diff)
downloadpoezio-103ddd762d7ed98ce263604de9979002e3ca47b3.tar.gz
poezio-103ddd762d7ed98ce263604de9979002e3ca47b3.tar.bz2
poezio-103ddd762d7ed98ce263604de9979002e3ca47b3.tar.xz
poezio-103ddd762d7ed98ce263604de9979002e3ca47b3.zip
Updated plugin doc
Diffstat (limited to 'doc')
-rw-r--r--doc/en/plugins.txt56
1 files changed, 51 insertions, 5 deletions
diff --git a/doc/en/plugins.txt b/doc/en/plugins.txt
index 706a7e50..079e258b 100644
--- a/doc/en/plugins.txt
+++ b/doc/en/plugins.txt
@@ -94,7 +94,53 @@ CAUTION: TODO
[[events-list]]
Events list
-----------
-CAUTION: TODO
+
+SleekXMPP events
+~~~~~~~~~~~~~~~~
+
+For the sleekxmpp events, please refer to the https://github.com/fritzy/SleekXMPP/wiki/Event-Index[sleekxmpp event index].
+
+
+Poezio events
+~~~~~~~~~~~~~
+
+*muc_say*:: +message+, +tab+ +
+The handlers for this event are called whenever you say something in a MUC (through the /say command or by direct input). The parameters given to the handlers anre:
+
+* _message_: Message to be sent
+* _tab_: Tab in which the message will be sent
+
+*private_say*:: +message+, +tab+ +
+The handlers for this event are called whenever you say something in a private conversaton in a MUC (through the /say command or by direct input). The parameters given to the handlers are:
+
+* _message_: Message to be sent
+* _tab_: Tab in which the message will be sent
+
+*conversation_say*:: +message+, +tab+ +
+The handlers for this event are called whenever you say something in direct conversation (through the /say command or by direct input). The parameters given to the handler are:
+
+* _message_: Message to be sent
+* _tab_: Tab in which the message will be sent
+
+*muc_msg*:: +message+, +tab+ +
+The handlers for this event are called whenever you receive a message in a MUC. The parameters given to the handler are:
+
+* _message_: Message received
+* _tab_: Tab in which the message was received
+
+*private_msg*:: +message+, +tab+ +
+The handlers for this event are called whenever you receive a message in a private conversation in a MUC. The parameters given to the handler are:
+
+* _message_: Message received
+* _tab_: Tab in which the message was received
+
+*conversation_msg*:: +message+, +tab+ +
+The handlers for this event are called whenever you receive a message in a direct conversation. The parameters given to the handler are:
+
+* _message_: Message received
+* _tab_: Tab in which the message was received
+
+CAUTION: Plugins are in an experimental state and this API might change slightly in a near future. You have to be aware of that while making a plugin.
Examples
--------
@@ -108,7 +154,7 @@ class Plugin(BasePlugin):
def init(self):
self.add_command('hello', self.command_hello, "Usage: /hello\nHello: Send 'Hello World!'", None)
- def command_hello(self, args):
+ def command_hello(self, arg):
self.core.send_message('Hello World!')
---------------
=====================================================================
@@ -121,11 +167,11 @@ class Plugin(BasePlugin):
---------------
class Plugin(BasePlugin):
def init(self):
- self.add_event_handler('groupchat_message', self.on_groupchat_message)
+ self.add_event_handler('muc_msg', self.on_groupchat_message)
- def on_groupchat_message(self, message):
+ def on_groupchat_message(self, message, tab):
if message['mucnick'] == "Partauche":
- self.core.send_message('tg', to=message.getMucroom())
+ tab.command_say('tg')
---------------
=====================================================================