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

Slack: A message property returning if it's an edit #36

Open
1 task done
rcoup opened this issue Dec 7, 2017 · 5 comments
Open
1 task done

Slack: A message property returning if it's an edit #36

rcoup opened this issue Dec 7, 2017 · 5 comments

Comments

@rcoup
Copy link

rcoup commented Dec 7, 2017

In order to let us help you better, please fill out the following fields as best you can:

I am...

  • Suggesting a new feature

I am running...

  • Errbot version: 5.1.3
  • OS version: Debian (python Docker)
  • Python version: 3.6
  • Using a virtual environment: no

Issue description

After errbotio/errbot#382, when messages are edited in Slack, Errbot plugins receive them again. If the bot responds to a message (eg. "ticket errbotio/errbot#1234" -> {details of ticket}) then the channel keeps getting additional replies over & over.

Would be nice to be able to detect a message as an edit so the botcmd can skip it. eg. if msg.is_edit: return

This doesn't solve all use cases (eg. "ticket errbotio/errbot#1234" edited to "ticket errbotio/errbot#1235" when the bot should respond with different content) but does help the common case, and could be built on to support that sort of thing.

@andrewthetechie
Copy link

https://github.com/errbotio/errbot/issues/1032 is related to this

@sijis
Copy link
Collaborator

sijis commented Jan 10, 2019

They are different. This is asking for a property to be added to the msg object. The other ticket is looking for a mechanism to have a plugin reply update an existing messge (if the backend supports the feature).

@andrewthetechie
Copy link

Yup, but they're a bit related imho. If a plugin can update/edit a message, it would be good to be able to check if a new message coming in is edited.

@sijis
Copy link
Collaborator

sijis commented Jun 18, 2019

Possibly related: errbotio/errbot#1269

@sijis sijis transferred this issue from errbotio/errbot Jul 23, 2021
@nzlosh
Copy link
Collaborator

nzlosh commented Jul 23, 2021

Access to the underlying slack event is possible with the slackv3 backend.

"slack_event": event,

Below is an extract from a slack event that contains a message edit:

 'subtype': 'message_changed',
 'ts': '1627072096.001000',
 'type': 'message'}

Plugins that need to make a decision on how to handle message edits, have access to this event via msg.extras property and can decide how to process the changed text.

This feature should be documented to be clearly understood by future plugin developers.

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

4 participants