os / slacker

Full-featured Python interface for the Slack API
Apache License 2.0
1.6k stars 245 forks source link

Parse in chat update function? #69

Closed EnyMan closed 8 years ago

EnyMan commented 8 years ago

Hi i noticed that you added parse option to chat.update but you might have forgotten to actually pass the variable to the post method is that intentional or was that mistake?

def update(self, channel, ts, text, attachments=None, parse=None,
               link_names=False, as_user=None):
        # Ensure attachments are json encoded
        if attachments and isinstance(attachments, list):
            attachments = json.dumps(attachments)
        return self.post('chat.update',
                         data={
                             'channel': channel,
                             'ts': ts,
                             'text': text,
                             'attachments': attachments,
                             'parse': None, #<--------------- change here
                             'link_names': int(link_names),
                             'as_user': as_user,
})

shouldnt this be

  def update(self, channel, ts, text, attachments=None, parse=None,
               link_names=False, as_user=None):
        # Ensure attachments are json encoded
        if attachments and isinstance(attachments, list):
            attachments = json.dumps(attachments)
        return self.post('chat.update',
                         data={
                             'channel': channel,
                             'ts': ts,
                             'text': text,
                             'attachments': attachments,
                             'parse': parse, #<--------------- change here
                             'link_names': int(link_names),
                             'as_user': as_user,
})

otherwise the param in the function is pointless.

os commented 8 years ago

Good catch, thanks for that! Fixed in https://github.com/os/slacker/commit/3905cbc5907a619a01d3c8491fe8978617c9fe2f.