lamby / django-slack

Slack integration for Django, using the templating engine to generate messages
https://django-slack.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
241 stars 57 forks source link

chat.update #99

Open mtrofimiuk opened 3 years ago

mtrofimiuk commented 3 years ago

I have created a small improvement to update messages however it might be breaking due to this change:

https://github.com/mtrofimiuk/django-slack/commit/c7508b1d9bcc84e45c179b2dadd05051be46ea5c#diff-7a19d37208dbf10969c8d4f3375fcc78607e4842982a081c9bdc73f4ac46fe56L146-L147

For what scenarios, I do not understand why it is needed.

Anyway if you are interested in merging it to the project I can spend some more time polishing it.

lamby commented 3 years ago

I think I would need to work out what this does/fixes before I could safely merge it. :)

mtrofimiuk commented 3 years ago

Sure, have a look when you have time.

It allows making such calls.

slack_message(
        "template.slack",
        channel=settings.SLACK_CHANNEL_ID,  # pity that this needs to be numerical channel id not name
        ts=original_message_ts, 
        endpoint_url="https://slack.com/api/chat.update",
    )

And by the way, it allows changing unfurling by default. It should go to a separate patch probably, but cannot stand this in slack.