From 893a4afe02007f97c0b3744db824231faae97cce Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Fri, 13 Mar 2020 22:24:33 +0000 Subject: [PATCH] Clean up converse() code The method signature was different from the parent class, and the `else:` block was redundant. As an aside, I'm a new skill developer and this documentation has created more questions than answers for me. From what I'm reading here, all I should need to do is add a `converse()` method and it'll be triggered before the intent handler... except in my experience it's not triggered at all. --- docs/skill-development/introduction/lifecycle-methods.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/skill-development/introduction/lifecycle-methods.md b/docs/skill-development/introduction/lifecycle-methods.md index 4eb5aeb5..e816f657 100644 --- a/docs/skill-development/introduction/lifecycle-methods.md +++ b/docs/skill-development/introduction/lifecycle-methods.md @@ -49,12 +49,11 @@ If the utterance is handled by the converse method, we return `True` to indicate In the following example, we check that utterances is not empty, and if the utterance matches vocabulary from `understood.voc`. If the user has understood we speak a line from `great.dialog` and return `True` to indicate the utterance has been handled. If the vocabulary does not match then we return `False` as the utterance should be passed to the normal intent matching service. ```text - def converse(self, utterances, lang): + def converse(self, utterances, lang=None): if utterances and self.voc_match(utterances[0], 'understood'): self.speak_dialog('great') return True - else: - return False + return False ``` ## Stop