slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.6k stars 1.11k forks source link

add deleted timestamp for deleted msg events #1261

Closed zFlabmonsta closed 4 months ago

zFlabmonsta commented 4 months ago

When a slack message is deleted an event is sent with the deleted_timestamp field in the payload.

{
  "token": "*****",
  "team_id": "*****",
  "enterprise_id": "*****",
  "context_team_id": null,
  "context_enterprise_id": "*****",
  "api_app_id": "*****",
  "event": {
    "type": "message",
    "subtype": "message_deleted",
    "previous_message": {
      "client_msg_id": "*****",
      "type": "message",
      "text": "kkkk",
      "user": "*****",
      "ts": "1707375397.979789",
      "blocks": [
        {
          "type": "rich_text",
          "block_id": "Ygihn",
          "elements": [
            {
              "type": "rich_text_section",
              "elements": [
                {
                  "type": "text",
                  "text": "kkkk"
                }
              ]
            }
          ]
        }
      ],
      "team": "*****",
      "user_team": "*****",
      "source_team": "*****",
      "thread_ts": "1707372155.446849",
      "parent_user_id": "*****"
    },
    "channel": "*****",
    "hidden": true,
    "deleted_ts": "1707375397.979789",    // <----
    "event_ts": "1707392586.005800",
    "ts": "1707392586.005800",
    "channel_type": "channel"
  },
  "type": "event_callback",
  "event_id": "*****",
  "event_time": 1707392586,
  "authorizations": [
    {
      "enterprise_id": "*****",
      "team_id": null,
      "user_id": "*****",
      "is_bot": true,
      "is_enterprise_install": true
    }
  ],
  "is_ext_shared_channel": true,
  "event_context": "*****"
}
Pull Request Guidelines

These are recommendations for pull requests. They are strictly guidelines to help manage expectations.

PR preparation

Run make pr-prep from the root of the repository to run formatting, linting and tests.

Should this be an issue instead
API changes

Since API changes have to be maintained they undergo a more detailed review and are more likely to require changes.

Examples of API changes that do not meet guidelines:
zFlabmonsta commented 4 months ago

@parsley42 👋 , pretty simple addition