Initial template for commitbot. Saving work.
This commit is contained in:
commit
8db2d69000
28
commitbot.py
Normal file
28
commitbot.py
Normal file
@ -0,0 +1,28 @@
|
||||
from twisted.words.xish import domish
|
||||
from wokkel.subprotocols import XMPPHandler
|
||||
from wokkel.xmppim import AvailablePresence, Presence
|
||||
|
||||
NS_MUC = 'http://jabber.org/protocol/muc'
|
||||
|
||||
class CommitBot(XMPPHandler):
|
||||
|
||||
def __init__(self, room, nick):
|
||||
XMPPHandler.__init__(self)
|
||||
|
||||
self.room = room
|
||||
self.nick = nick
|
||||
self.joined = False
|
||||
|
||||
def connectionMade(self):
|
||||
self.send(AvailablePresence())
|
||||
|
||||
# add handlers
|
||||
|
||||
# join room
|
||||
pres = Presence()
|
||||
pres['to'] = self.room + '/' + self.nick
|
||||
pres.addElement((NS_MUC, 'x'))
|
||||
|
||||
|
||||
|
||||
|
3
commitbot.tac.example
Normal file
3
commitbot.tac.example
Normal file
@ -0,0 +1,3 @@
|
||||
# -*- mode: python -*-
|
||||
|
||||
from twisted.application import service
|
Loading…
x
Reference in New Issue
Block a user