XMPP bot

I’ve revived an XMPP bot forgotten in my git repo. It was written back in 2010 fork of another xmpp bot (cf. sid/sid.py for copyrights). The xmpp client is built on top of slixmpp an async xmpp module.

It was originally written for the Debian chat room at jabberfr. It is still its main purpose but can be extended for whatever suits you. Check for the code on the project page.

Current plugins:

  • archive: show package versions in Debian archive
  • bts: deal with the Debian bug tracking system
  • echo: a poste restante service, leave a message to be re-delivered latter
  • feeds: monitors xml feeds
  • ping: plain ping

The bot is still in development, you’ll need to write some python to configure/run it, it’s pretty simple though:

#!/usr/bin/env python3
import getpass

from sid.sid import MUCBot
from sid.ping import Ping

JID = 'bot@example.org'
NICK = 'sid'
PASS = getpass.getpass('Password for "{}": '.format(JID))
ROOM = 'room@conf.example.org'

xmpp = MUCBot(JID, PASS, ROOM, NICK)
xmpp.register_bot_plugin(Ping)
try:
    xmpp.connect()
    xmpp.process()
except KeyboardInterrupt:
    xmpp.shutdown_plugins()
xmpp.log.info('Done')

Please refer to the dedicated page for more. Happy hacking!

page last updated: Mon 04 May 2020