def isInCooldown(self): chatCommand = self.getChatCommand() result = False message = '' if cooldown.isOperationInCooldownEx(chatCommand): result = True message = cooldown.getOperationInCooldownMsg(chatCommand, cooldown.getOperationCooldownPeriodEx(chatCommand)) return (result, message)
def isInCooldown(self): chatCommand = self.getChatCommand() result = False message = '' if cooldown.isOperationInCooldownEx(chatCommand): result = True message = cooldown.getOperationInCooldownMsg(chatCommand, cooldown.getOperationCooldownPeriodEx(chatCommand)) return (result, message)
def __um_onSearchTokenFailed(self, requestID, actionResponse, data): if self._lastRequestID == requestID: if actionResponse == chat_shared.CHAT_RESPONSES.commandInCooldown: reason = cooldown.getOperationInCooldownMsg(self.getChatCommand(), data.get('cooldownPeriod', -1)) self._onSearchFailed(reason) elif actionResponse == chat_shared.CHAT_RESPONSES.incorrectCharacter: reason = i18n.makeString(MESSENGER.CLIENT_WARNING_INVALIDUSERSEARCHTOKEN_MESSAGE, _ACCOUNT_NAME_MIN_LENGTH, _ACCOUNT_NAME_MAX_LENGTH) self._onSearchFailed(reason)
def __um_onSearchTokenFailed(self, requestID, actionResponse, data): if self._lastRequestID == requestID: if actionResponse == chat_shared.CHAT_RESPONSES.commandInCooldown: reason = cooldown.getOperationInCooldownMsg(self.getChatCommand(), data.get('cooldownPeriod', -1)) self._onSearchFailed(reason) elif actionResponse == chat_shared.CHAT_RESPONSES.incorrectCharacter: reason = i18n.makeString(MESSENGER.CLIENT_WARNING_INVALIDUSERSEARCHTOKEN_MESSAGE, _ACCOUNT_NAME_MIN_LENGTH, _ACCOUNT_NAME_MAX_LENGTH) self._onSearchFailed(reason)
def create(cls, chatAction): chatActionDict = dict(chatAction) data = chatActionDict.get('data', {'command': None, 'cooldownPeriod': -1}) result = None if data['command'] is not None: result = CommandInCooldownError(cls._makeTitle('commandInCooldown'), getOperationInCooldownMsg(data['command'], data['cooldownPeriod']), isModal=False) else: LOG_ERROR('CommandInCooldown', chatActionDict) return result
def create(cls, chatAction): chatActionDict = dict(chatAction) data = chatActionDict.get('data', {'command': None, 'cooldownPeriod': -1}) result = None if data['command'] is not None: result = CommandInCooldownError(cls._makeTitle('commandInCooldown'), getOperationInCooldownMsg(data['command'], data['cooldownPeriod']), isModal=False) else: LOG_ERROR('CommandInCooldown', chatActionDict) return result
def __cm_onSearchTokenFailed(self, requestID, actionResponse, data): if self._lastRequestID == requestID: if actionResponse == chat_shared.CHAT_RESPONSES.commandInCooldown: reason = cooldown.getOperationInCooldownMsg( self.getChatCommand(), data.get('cooldownPeriod', -1)) self._onSearchFailed(reason)
def __cm_onSearchTokenFailed(self, requestID, actionResponse, data): if self._lastRequestID == requestID: if actionResponse == chat_shared.CHAT_RESPONSES.commandInCooldown: reason = cooldown.getOperationInCooldownMsg(self.getChatCommand(), data.get('cooldownPeriod', -1)) self._onSearchFailed(reason)