mirror of
https://github.com/nikdoof/python-ts3.git
synced 2025-12-17 03:49:25 +00:00
fixed clientkick command as it was not working properly
This commit is contained in:
@@ -321,17 +321,20 @@ class TS3Server(TS3Proto):
|
|||||||
if cldbid:
|
if cldbid:
|
||||||
response = self.send_command('clientlist')
|
response = self.send_command('clientlist')
|
||||||
for cl in response.data:
|
for cl in response.data:
|
||||||
if int(cl['keys']['client_database_id']) == cldbid:
|
if int(cl['client_database_id']) == cldbid:
|
||||||
client = cl['keys']['clid']
|
client = cl['clid']
|
||||||
self.logger.debug("clientkick - identified user from clid (%s = %s)" % (cldbid, client))
|
self.logger.debug("clientkick - identified user from clid (%s = %s)" % (cldbid, client))
|
||||||
break
|
break
|
||||||
client = 0
|
|
||||||
|
if not client:
|
||||||
|
# we should throw an exception here actually
|
||||||
|
self.logger.debug("clientkick - no client with specified cldbid (%s) was found" % cldbid)
|
||||||
|
return False
|
||||||
elif clid:
|
elif clid:
|
||||||
client = clid
|
client = clid
|
||||||
else:
|
else:
|
||||||
raise InvalidArguments('No clid or cldbid provided')
|
raise InvalidArguments('No clid or cldbid provided')
|
||||||
|
|
||||||
if type == REASON_KICK_CHANNEL:
|
|
||||||
if not message:
|
if not message:
|
||||||
message = ''
|
message = ''
|
||||||
else:
|
else:
|
||||||
@@ -343,4 +346,4 @@ class TS3Server(TS3Proto):
|
|||||||
response = self.send_command('clientkick', keys={'clid': client, 'reasonid': type, 'reasonmsg': message})
|
response = self.send_command('clientkick', keys={'clid': client, 'reasonid': type, 'reasonmsg': message})
|
||||||
return response.is_successful
|
return response.is_successful
|
||||||
|
|
||||||
return false
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user