コード例 #1
0
ファイル: __init__.py プロジェクト: VerHext/pyTSon_plugins
 def commandToggleRecord(self, schid, targetMode, toID, fromID, params=""):
     (error, clid) = ts3lib.getClientID(schid)
     (error, recording) = ts3lib.getClientVariableAsInt(schid, clid, ts3defines.ClientProperties.CLIENT_IS_RECORDING)
     if not recording:
         ts3lib.startVoiceRecording(schid)
     elif recording:
         ts3lib.stopVoiceRecording(schid)
コード例 #2
0
 def stopVoiceRecording(self, schid):
     if self.hook:
         sendCommand(self.name,
                     "clientupdate client_is_recording=0",
                     schid,
                     mode=2)
     else:
         # ts3lib.setClientSelfVariableAsInt(schid, ts3defines.ClientProperties.CLIENT_IS_RECORDING, False)
         ts3lib.stopVoiceRecording(schid)
コード例 #3
0
 def tick(self):
     if not self.schid or self.schid < 1: self.timer.stop()
     if self.hook:
         sendCommand(self.name, "clientupdate client_is_recording=1",
                     self.schid)
         sendCommand(self.name, "clientupdate client_is_recording=0",
                     self.schid)
     else:
         ts3lib.startVoiceRecording(self.schid)
         ts3lib.stopVoiceRecording(self.schid)
コード例 #4
0
 def onServerErrorEvent(self, schid, errorMessage, error, returnCode,
                        extraMessage):
     if not self.timer.isActive(): return
     if error == ts3defines.ERROR_client_is_flooding:
         ts3lib.printMessageToCurrentTab(
             "{}: [color=red][b]Client is flooding, stopping!".format(
                 self.name))
         self.timer.stop()
         if self.hook:
             sendCommand(self.name, "clientupdate client_is_recording=0",
                         self.schid)
         else:
             ts3lib.stopVoiceRecording(self.schid)
         return True
コード例 #5
0
 def onHotkeyOrCommandEvent(self, keyword, schid=0):
     if not schid: schid = ts3lib.getCurrentServerConnectionHandlerID()
     if keyword == "request_talk_power":
         (err, oldnick) = ts3lib.getClientSelfVariable(
             schid, ts3defines.ClientProperties.CLIENT_NICKNAME)
         ts3lib.setClientSelfVariableAsString(
             schid, ts3defines.ClientProperties.CLIENT_NICKNAME,
             self.tpr_name)
         ts3lib.flushClientSelfUpdates(schid)
         if self.hook:
             sendCommand(self.name, "clientupdate client_is_recording=1",
                         schid)
             sendCommand(self.name, "clientupdate client_is_recording=0",
                         schid)
         else:
             ts3lib.startVoiceRecording(schid)
             ts3lib.stopVoiceRecording(schid)
         ts3lib.setClientSelfVariableAsString(
             schid, ts3defines.ClientProperties.CLIENT_NICKNAME, oldnick)
         ts3lib.flushClientSelfUpdates(schid)