Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete or undo last N messages #144

Closed
b4hand opened this issue Jan 21, 2015 · 5 comments
Closed

Delete or undo last N messages #144

b4hand opened this issue Jan 21, 2015 · 5 comments

Comments

@b4hand
Copy link

b4hand commented Jan 21, 2015

It would be nice to be able to delete or undo the last message or last N messages that hubot sends.

I know this can be done manually via an admin, but would prefer a programmatic solution.

I'd be willing to accept deletion of just a single message id alternatively.

@evansolomon
Copy link
Contributor

I think this will need support from the websocket API to edit messages. Could be wrong, but can't find anything on it in the docs https://api.slack.com/rtm. @paulhammond?

@b4hand
Copy link
Author

b4hand commented Jan 21, 2015

I saw this https://api.slack.com/methods/chat.delete, but I wasn't sure how that related to the RTM api.

@paulhammond
Copy link
Contributor

Sorry for the delay in replying!

The API token used to connect to the RTM API also has the ability to call web API methods - and the node-slack-client code used by hubot will have the ability to update and delete messages in the next version (see slackapi/node-slack-sdk#14 and slackapi/node-slack-sdk#17). So, once that's out you'll just need to call the right methods on the message object!

@brianantonelli
Copy link

I wrote a Hubot plugin for misc Slack utilities of which the first is a command for deleting the last N Hubot posts. I wanted to use the Slack Node Client as @paulhammond referenced above, but unfortunately there are some issues with their SDK in which it doesn't return a list of a channel's conversation history. Because of this issue (there are pull requests addressing it) I chose to interface directly with Slack's REST API for my module.

See more here: https://github.com/Cox-Automotive/hubot-slack-utils

@DEGoodmanWilson
Copy link

I'm going to close this as resolved for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants