-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcommitbot.tac.example
More file actions
36 lines (25 loc) · 1.03 KB
/
commitbot.tac.example
File metadata and controls
36 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- mode: python -*-
from twisted.application import service, internet
from twisted.web import server
from twisted.words.protocols.jabber import jid
from wokkel.client import XMPPClient
from commitbot import CommitBot, WebHook
# Configuration
# Change these values
jabber_id = 'user@example.com' # Jabber-ID
password = 'password' # Password
room = 'room@chat.example.com' # Room (including server)
bot_name = 'gitbot' # Display name for bot
room_pass = None # Set this to the room password, if any, or leave it as None
# You may optionally change the TCP port the server will be listening on
serv_port = 8888 # Port the webserver should run on
# That's it, you're all set.
application = service.Application('commitbot')
client = XMPPClient(jid.internJID(jabber_id), password)
client.logTraffic = True
bot = CommitBot(room, bot_name, None)
bot.setHandlerParent(client)
client.setServiceParent(application)
site = server.Site(WebHook(bot))
server = internet.TCPServer(serv_port, site)
server.setServiceParent(application)