Project Homepage (Download link) | User Guide | Project Wiki | Source Codes | Discussion Forum |
---|
Table Of Contents
IMPyBot (impybot) is a bot (IM automatic response) framework for XMPP protocol. It provides a plug-in system, so that the implementation of a utility is isolated from implementation of the bot. This provides great convenience to manage the utilities without touching the bot itself. The plug-in system is sophisticated that it enables developer to write really large and powerful plug-ins. Meanwhile, it also provides a simple interface such that users with little Python experience can write useful utilities as well.
The figure below illustrates the structure of IMPyBot framework. As shown, the plug-ins are isolated from the bot itself. Plugin developers who are only interested in writing utilities like weather querier or calculators does not need to know the details of the bot at all. What is more important, this provides an easier way to organize and manage all the plugins.
+------------------------------------------------------------+ | | | The Plug-ins | | +--------------------------------------------+ | | | +---------+ +------------+ +------------+ | | | | | weather | | dictionary | | calculator | | | | | +---------+ +------------+ +------------+ | | | +--------------------------------------------+ | | | | | | plug in | | v | | +--------------------------------------------+ | | | The XMPP Bot Framework | | | +--------------------------------------------+ | | | ^ | | | | | | v | | | +--------------------------------------------+ | | | Internet | | | +--------------------------------------------+ | | | | | +------------------------------------------------------------+ Figure 1. Illustration of the IMPyBot Framework
sudo python setup.py install
setup.py installNOTE for Windows Vista and Windows 7 users: you must open the command windows as administrator.
You can also use IMPyBot without installing it to the system location.
run_bot.py -j "username" -p "password"
To write your own utilities (we call it a plugin), simply follow these TWO steps:
Create a text file called my_first_plugin.py
, with codes look
like the following:
Invoke the command line tool to run a bot and tell it where your plugin is:
python -m run_bot -j "jid@server.com" -p "password" -m my_first_plugin.py
Congratulations on your first Instant Messaging Application!