[Twisted-Python] Creating a protocol-agnostic chatbot with Twisted words

Ralph Meijer twisted at ralphm.ik.nu
Mon May 26 11:39:51 EDT 2008

On Mon, 2008-05-26 at 12:49 +0200, Jo Vermeulen wrote:
> I have a XMPP version working, but had some problems finding my way
> around a few features. I don't know how to get a list of contacts, or
> initiatiate a group chat.

There is no such abstraction in Twisted for XMPP, yet. I've worked on a
framework for implementing XMPP's 'subprotocols' in the Wokkel library
[1] and this framework has been contributed back into Twisted recently,
and has been part of the Twisted 8.0.1 release. On top of that there are
several of such subprotocols implemented in Wokkel, among them the
protocol implementations for dealing with rosters (client and server
side). All of those should eventually go back in Twisted when I get
around to it.

As far as I know, there is no implementation for the client side of the
multi-user chat (MUC) protocol yet built on Twisted, although there is a
MUC service called Palaver. Its authors are considering rewriting the
protocol handling part to match the subprotocol abstraction I mentioned

> Even if I succeed in doing this, would it be possible to generalize
> this for both XMPP and MSN?

Sure. No one has stepped up to make that happen, recently. Personally, I
have very little interest in supporting closed protocols like MSN's.
However, there is the concept of XMPP gateways to other IM networks that
might be useful for you. It would allow you to create a bot that talks
using one protocol (XMPP).

> Finally, I was wondering how mature Twisted words is. It seems to work
> well for XMPP, but how mature is the MSN support? Are there other
> libraries I could consider, or is it possible to generalize other
> libraries within Twisted?

I would say that the XMPP and IRC parts of Words have seen the most
activity recently. The XMPP stuff works well, supports a fair number of
projects, but is a bit spartan. I'm working hard to address the latter,

I cannot comment much on the other parts, although I know there has been
work on Twisted based XMPP gateways to AIM and ICQ, that have more
mature implementations of those than what is currently in Words. So far
there hasn't been much progress to move those improvements back into
Words [2].

[1] http://wokkel.ik.nu/
[2] http://twistedmatrix.com/trac/ticket/1081



More information about the Twisted-Python mailing list