Possible typo in Padatious code in documentation?

In the Tomato Skill code for Padatious:

there is this line to get a wild card from the utterance in the passed message:

def handle_do_you_like(self, message):
        tomato_type = message.get('type')

However when I execute the following:

`self.file_name = message.get('filename')+ ".txt"`

I get an error, and the mycroft-skill.log file states:

AttributeError: 'Message' object has no attribute 'get'

Changing the code to:

self.file_name = message.data.get('filename')+ ".txt"

corrects the problem.

In the documentation, this message.data.get() format is mentioned below the Tomato skill example.

Not sure if this is a type or is the message.get is meant to be used differently, but thought I would point it out.

Great pickup. I’ll get @Wolfgange to confirm for me, then update the doco.

Sorry for the delay, @gov thanks for pointing that out. You’re absolutely correct. It should be message.data.get(. Thanks!
@KathyReid If the docs haven’t been updated, that change looks good to me. :slight_smile:


Confirming the doco is now updated;

Kind regards,

1 Like