Skip to content

Commit

Permalink
chat: DeleteMessage
Browse files Browse the repository at this point in the history
Calls `https://slack.com/api/chat.delete` to delete a message.
  • Loading branch information
ericmeter committed Jun 9, 2023
1 parent 3f2dfad commit a7d4078
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ func (c *ChatService) PostMessage(ctx context.Context, data url.Values) (*respon
return resp, err
}

// https://api.slack.com/methods/chat.delete
func (c *ChatService) DeleteMessage(ctx context.Context, channelID, messageID string) (*response, error) {
data := url.Values{
"channel": []string{channelID},
"ts": []string{messageID},
}
resp := new(response)
err := c.client.CreateResource(ctx, "/api/chat.delete", data, resp) // Delete is a POST
return resp, err
}

// https://api.slack.com/methods/chat.getPermalink
//
// `channelID` has to be the ID of the channel (C*), this endpoint does not
Expand Down

0 comments on commit a7d4078

Please sign in to comment.