Skip to content

Commit

Permalink
Added grouplist query to TS3Clients
Browse files Browse the repository at this point in the history
  • Loading branch information
derkalle4 committed May 25, 2015
1 parent 5c2f0d8 commit e8011cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/core_TS3clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
nextClientlistInterval = 2
nextClientlist = 0
clientlist = {}
nextGrouplistInterval = 30
nextGrouplist = 0
grouplist = {}

def setup(ts3base):
global base
Expand All @@ -27,6 +30,15 @@ def clientlist(self, flags='-uid -away -voice -times -groups -info -icon -countr
nextClientlist = time.time() + nextClientlistInterval
return clientlist

# get list of groups
def grouplist(self):
global grouplist, nextGrouplist
if nextGrouplist <= time.time():
grouplist = ts3tools.parse_raw_data(base.send_receive('servergrouplist'), 'sgid')
nextGrouplist = time.time() + nextGrouplistInterval
print(grouplist)
return grouplist

def clientmove(self, clid, cid):
clidstring = ''
if isinstance(clid, list):
Expand Down

0 comments on commit e8011cc

Please sign in to comment.