def generateResponse(self, module, operation): response = Response() if module == 'google': response.texts.append(Google.getResult(operation)) if module == 'wikipedia': response.texts.append(Wikipedia.getSummary(operation)) if module == 'imdb': response.texts = IMDB.getMovieInfo(operation) if module == 'releases': response.texts.append(Releases.getReleaseDate(operation)) if module == 'lyrics': response.texts.append(Lyrics.getLyrics(operation)) if module == 'reddit': response.texts = self.handleReddit(operation) if module == 'wolfram': response.images = Wolfram.getImages(operation) if module == 'network': response.text = network.scan() if module == 'hltb': response.text = (hltb.getTimes(opertaion)) if module == 'hltr': response.texts.append(hltr.getInfo(operation)) if module == 'espeak': espeak.speak(operation) response.texts.append('Done, sir') if not response.texts and not response.images and not response.audios: response.texts = ['I\'m sorry dave, I\'m afraid I can\'t do that'] return response