Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 87 lines (55 sloc) 2.359 kb
8814fe6 Andrés J. Díaz initial version
authored
1 Whistler Bot
2 ============
3
e90b09f Andrés J. Díaz Improvement documentation.
authored
4 Whistler Bot is an XMPP bot written in python using SleekXMPP_, which is
5 a requirement. The bot is designed to handle some commands, and it is easy to
8814fe6 Andrés J. Díaz initial version
authored
6 extend.
7
e90b09f Andrés J. Díaz Improvement documentation.
authored
8 .. image:: https://pypip.in/v/whistler/badge.png
9 :target: https://crate.io/packages/whistler/
10 :alt: Latest PyPI version
8814fe6 Andrés J. Díaz initial version
authored
11
e90b09f Andrés J. Díaz Improvement documentation.
authored
12 .. image:: https://pypip.in/d/whistler/badge.png
13 :target: https://crate.io/packages/whistler/
14 :alt: Number of PyPI downloads
15
16 Simple usage:
17
18 .. code-block:: bash
19
20 $ whistler myconfig.conf
21
22 Create bot programmatically:
23
24 .. code-block:: python
8814fe6 Andrés J. Díaz initial version
authored
25
e90b09f Andrés J. Díaz Improvement documentation.
authored
26 from whistler.bot import WhistlerBot
27
8814fe6 Andrés J. Díaz initial version
authored
28 bot = WhistlerBot( "myjid@myserver.com", "mypassword" )
29 bot.start()
30
31
e90b09f Andrés J. Díaz Improvement documentation.
authored
32 .. _SleekXMPP: https://github.com/fritzy/SleekXMPP
33
8814fe6 Andrés J. Díaz initial version
authored
34
35 Extending bot
36 -------------
37 You can extend the bot functionalities, just see for example the code of the
38 whistler console script. In short you can add commands creating a new class
e90b09f Andrés J. Díaz Improvement documentation.
authored
39 from WhistlerBot, and define new functions in the form ``cmd_<command>`` plus the
40 command name, for example, to handle the command *ping*.
8814fe6 Andrés J. Díaz initial version
authored
41
e90b09f Andrés J. Díaz Improvement documentation.
authored
42 .. code-block:: python
8814fe6 Andrés J. Díaz initial version
authored
43
e90b09f Andrés J. Díaz Improvement documentation.
authored
44 from whistler.bot import WhistlerBot
45
8814fe6 Andrés J. Díaz initial version
authored
46 class MyBot(WhistlerBot):
e90b09f Andrés J. Díaz Improvement documentation.
authored
47
8814fe6 Andrés J. Díaz initial version
authored
48 def cmd_ping(self, msg, args):
49 return "pong"
50
51
e90b09f Andrés J. Díaz Improvement documentation.
authored
52 Example chat
53 ------------
54
95a89bb Andrés J. Díaz Fix README.
authored
55 .. image:: doc/source/_static/whistler_screenshot.png
e90b09f Andrés J. Díaz Improvement documentation.
authored
56 :align: left
57 :alt: An example of chat with Whistler
58
59 Whistler allows to send private commands in usual jabber (and of course
60 GTalk and Google Hangouts) chat.
61
62 Also public commands are available, prefixed them with "!" (exclamation mark),
63 as also reply to a direct mention in the form "whistler:" or "whistler,", where
64 "whistler" is the nickname of the bot in the MUC::
65
66 (Me) whistler: uptime
67 (whistler) 17:33:01 up 2 days, ...
68
69 Currently Whistler support a number of features, including tweet from
70 command, shorting url action and so on...
71
72 You can see the mixins_ directory to see a number of examples for whistler
73 and how easy is to extend.
74
75 .. _mixins: https://github.com/ajdiaz/whistler/tree/master/whistler/mixins
76
77
78 Contributions
79 -------------
80
81 Any new mixin or functionality is welcome to Whistler. If you has been
82 developed new one or want new feature, please `send me a message` or a `pull
83 request`_.
84
85 .. _`send me a message`: mailto:ajdiaz@connectical.com
86 .. _`pull request`: https://github.com/ajdiaz/whistler/pulls
Something went wrong with that request. Please try again.