Hello Alvin,<br><br>Thanks, MSNP8 should be enough for a chat bot. I&#39;ll have a look at the <a href="http://twisted.im">twisted.im</a> module, it seems to contain a basic multi-protocol chat client.<br><br>I had another question about the Jabber example (xmpp_client.py) in Twisted words. When I quit the application with Ctrl+C, it throws an exception:<br>
<br>Disconnected.<br>Traceback (most recent call last):<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/posixbase.py&quot;, line 228, in mainLoop<br>&nbsp;&nbsp;&nbsp; self.runUntilCurrent()<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/base.py&quot;, line 561, in runUntilCurrent<br>
&nbsp;&nbsp;&nbsp; call.func(*call.args, **<a href="http://call.kw">call.kw</a>)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/base.py&quot;, line 414, in _continueSystemEvent<br>&nbsp;&nbsp;&nbsp; callable(*args, **kw)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/base.py&quot;, line 375, in disconnectAll<br>
&nbsp;&nbsp;&nbsp; failure.Failure(main.CONNECTION_LOST))<br>--- &lt;exception caught here&gt; ---<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/python/log.py&quot;, line 48, in callWithLogger<br>&nbsp;&nbsp;&nbsp; return callWithContext({&quot;system&quot;: lp}, func, *args, **kw)<br>
&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/python/log.py&quot;, line 33, in callWithContext<br>&nbsp;&nbsp;&nbsp; return context.call({ILogContext: newCtx}, func, *args, **kw)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/python/context.py&quot;, line 59, in callWithContext<br>
&nbsp;&nbsp;&nbsp; return self.currentContext().callWithContext(ctx, func, *args, **kw)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/python/context.py&quot;, line 37, in callWithContext<br>&nbsp;&nbsp;&nbsp; return func(*args,**kw)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/tcp.py&quot;, line 576, in connectionLost<br>
&nbsp;&nbsp;&nbsp; Connection.connectionLost(self, reason)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/tcp.py&quot;, line 416, in connectionLost<br>&nbsp;&nbsp;&nbsp; protocol.connectionLost(reason)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/words/xish/xmlstream.py&quot;, line 82, in connectionLost<br>
&nbsp;&nbsp;&nbsp; self.dispatch(self, STREAM_END_EVENT)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/words/xish/utility.py&quot;, line 227, in dispatch<br>&nbsp;&nbsp;&nbsp; self._eventObservers[(priority, event)].callback(object)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/words/xish/utility.py&quot;, line 37, in callback<br>
&nbsp;&nbsp;&nbsp; methodwrapper(*args, **kwargs)<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/words/xish/utility.py&quot;, line 21, in __call__<br>&nbsp;&nbsp;&nbsp; self.method(*nargs, **nkwargs)<br>&nbsp; File &quot;xmpp_client.py&quot;, line 58, in disconnected<br>
&nbsp;&nbsp;&nbsp; reactor.stop()<br>&nbsp; File &quot;/usr/lib/python2.5/site-packages/twisted/internet/base.py&quot;, line 342, in stop<br>&nbsp;&nbsp;&nbsp; raise RuntimeError, &quot;can&#39;t stop reactor that isn&#39;t running&quot;<br>exceptions.RuntimeError: can&#39;t stop reactor that isn&#39;t running<br>
<br>Is there any way to modify this example so that it stops gracefully when Ctrl+C is pressed? Embedding the main script code in a try-except statement that catches KeyboardInterrupt doesn&#39;t help since Twisted seems to catch all exceptions itself.<br>
<br>I read about deferred&#39;s and errbacks, but I don&#39;t know where to add an errback to in the XMPP example. To the client? The XmlStream? The reactor?<br><br>Any pointers would be greatly appreciated ...<br><br>Thanks!<br>
<br>-- Jo<br><br><div class="gmail_quote">On Mon, May 26, 2008 at 2:37 PM, Alvin Delagon &lt;<a href="mailto:adelagon@gmail.com">adelagon@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There&#39;s a twisted MSNP8 (or is it MSNP9) implementation. It&#39;s experimental but it works. I managed to write an MSN gateway for XMPP deriving most of the codes from it.<br><br>----<br>Alvin Delagon<br><br><div class="gmail_quote">
<div><div></div><div class="Wj3C7c">
On Mon, May 26, 2008 at 6:49 PM, Jo Vermeulen &lt;<a href="mailto:jo.vermeulen@gmail.com" target="_blank">jo.vermeulen@gmail.com</a>&gt; wrote:<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">
Hello,<br><br>I am trying to create a chat bot that can work over both the XMPP and the MSN protocol using Twisted words. I have a couple of questions as a Twisted newbie :-)<br><br>Is there any documentation on how to create a protocol-agnostic chatbot with Twisted words? Or are there applications using Twisted words that offer multiple front-ends?<br>


<br>I have a XMPP version working, but had some problems finding my way around a few features. I don&#39;t know how to get a list of contacts, or initiatiate a group chat. Even if I succeed in doing this, would it be possible to generalize this for both XMPP and MSN?<br>


<br>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?<br>


<br>Thanks in advance!<br><font color="#888888"><br>-- Jo Vermeulen<br>
</font><br></div></div>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/" target="_blank">http://www.alvinatorsplayground.blogspot.com/</a>
</font><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br>