Controlling murmur through python

Murmur is an open source voice chat server. I made a python script to move inactive users to an afk channel, not much code but still a good example on how to speak with murmur through ICE:

#!/usr/bin/env python
# -*- coding: utf-8

import Ice

unincluded_channels=[1,3,4]

Ice.loadSlice('', ['-I' + Ice.getSliceDir(), "Murmur.ice" ] )
import Murmur
comm = Ice.initialize()
proxy = comm.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
murmur = Murmur.MetaPrx.checkedCast(proxy)
server = murmur.getServer(1)
for u in server.getUsers().values():
    if u.channel not in unincluded_channels:
        if (u.selfDeaf and u.idlesecs >= 300) or u.idlesecs >= 1800:
            u.channel = 1
            server.setState(u)
            server.sendMessage(u.session, "Moved for inactivity")

Comments are closed.