def grouplist(self): global grouplist, nextGrouplist if nextGrouplist <= time.time(): grouplist = ts3tools.parse_raw_data( base.send_receive('servergrouplist'), 'sgid') nextGrouplist = time.time() + nextGrouplistInterval return grouplist
def channellist(self, flags='-topic -flags -voice -limits -icon'): global channellist, nextChannellist if nextChannellist <= time.time(): channellist = ts3tools.parse_raw_data( base.send_receive('channellist ' + flags), 'cid') nextChannellist = time.time() + nextChannellistInterval return channellist
def clientlist( self, flags='-uid -away -voice -times -groups -info -icon -country'): global clientlist, nextClientlist if nextClientlist <= time.time(): clientlist = ts3tools.parse_raw_data( base.send_receive('clientlist ' + flags), 'clid') nextClientlist = time.time() + nextClientlistInterval return clientlist
def channeledit(self, cid, propertiesdict=[]): # parse all properties properties = '' for item in propertiesdict: properties = properties + ' ' + item + '=' + ts3tools.escape_text( str(propertiesdict[item])) return ts3tools.parse_raw_data( base.send_receive('channeledit cid=' + str(cid) + ' ' + properties))
def channelcreate(self, name, propertiesdict=[]): # parse all properties properties = '' for item in propertiesdict: properties = properties + ' ' + item + '=' + ts3tools.escape_text( str(propertiesdict[item])) return ts3tools.parse_raw_data( base.send_receive('channelcreate channel_name=' + ts3tools.escape_text(name) + properties))
def clientmove(self, clid, cid): clidstring = '' if isinstance(clid, list): i = False for one in clid: if i is False: clidstring += one i = True else: clidstring += '|' + one else: clidstring = clid return ts3tools.parse_raw_data( base.send_receive('clientmove clid=' + clidstring + ' cid=' + cid))