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

Support for slack attachments #351

Merged
merged 1 commit into from
Jun 13, 2018
Merged

Support for slack attachments #351

merged 1 commit into from
Jun 13, 2018

Conversation

Ashex
Copy link
Collaborator

@Ashex Ashex commented May 17, 2018

Added support for passing in a proper list for slack attachments. This can be used in the following fashion:

from will.plugin import WillPlugin
from will.decorators import respond_to


class AttachmentsPlugin(WillPlugin):

    @respond_to("attachments")
    def attachments(self, message):
        attachments = [
            {
                "fallback": "Support ticket #1943",
                "pretext": "A new ticket has been filed",
                "title": "Ticket #1943: Can't reset my password",
                "text": "Help! I tried to reset my password but nothing happened!",
                "color": "#7CD197"
            }
        ]
        self.say("Here's your attachments", message=message, attachments=attachments)

@skoczen
Copy link
Owner

skoczen commented Jun 6, 2018

Wow, love this. Thanks much, @Ashex !

@skoczen skoczen merged commit 2da427a into skoczen:master Jun 13, 2018
@skoczen
Copy link
Owner

skoczen commented Jun 13, 2018

This has been released in 2.1.3 - thanks again! :)

Ashex pushed a commit that referenced this pull request Feb 5, 2022
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

Successfully merging this pull request may close these issues.

3 participants