Вопрос

This question has been asked in different forms at different times,
But since things have changed quite a bit over time, and the existing answers are not very satisfactory to begin with, I permit myself to ask it again,

I want to implement a chat bot, for our team to be able to answer queries and accept commands (something roughly speaking like Github's hubot), I want to do this on top of Google Talk Service (the chat service which is inside Gmail and elsewhere), and I'd rather do it in Python or Go, on AWS (as opposed to using Google App Engine),

My question is there any Google chat client library in python or Go out there, which has been in active development in the past year?
Any suggestions regarding implementation of a chat bot is greatly appreciated.

My Plan is to have a Google talk client, running all the time that waits for people to talk to it and interpret their messages/commands (as opposed to running a server and dealing with user authentication and ...)

Это было полезно?

Решение 2

Google Talk uses plain XMPP with the only twist is that it requires non-standardized authentication schemes to log into their servers as a client (back then it was X-GOOGLE-TOKEN SASL mechanism, and now it's supposedly OAuth2) — server-to-server communication with gtalk servers works without any tweaks.

Note that you might as well consider setting up your own XMPP server as there are many free XMPP servers (ejabberd, prosody, openfire, jabberd2), and there are free XMPP-enabled web chat clients (with JWChat being one example) in case you'll want to enable people to chat directly from the web UI.

As to libraries, I heard it's fashionable to use the Twisted framework when writing network-enabled applications for Python, so look at what's available. go-xmpp mentioned by @jnml does not appear to support even the bare minumum requirements specified in the core XMPP RFC yet.

Другие советы

The Google Talk service is based on XMPP but uses some open but non-standard extensions although none of these are required to establish a connection. Any standard compliant client should work.

Quote from https://developers.google.com/talk/open_communications#developer

I am a developer of an IM client. How do I connect to the Google Talk service?

As long as you adhere to the requirements of the XMPP specs, you will be able to connect to the Google Talk service.

There nothing special, short of supporting XMPP-Core and XMPP-IM required to connect to Google Talk. It even supports SASL PLAIN mechanism for legacy reasons.


There is no good XMPP support in Go at the moment, several irons in the fire so to speak but all far from production ready and many abandoned projects. Going with one of the established Python libraries is your best bet.

Without putting too much thought into it I would go with Twisted Words or Wokkel

The only thing which might qualify and I'm aware of is mattn / go-xmpp.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top