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

Unable to pass attributes to Client constructor #28

Open
trburgess opened this issue Jan 21, 2017 · 2 comments
Open

Unable to pass attributes to Client constructor #28

trburgess opened this issue Jan 21, 2017 · 2 comments

Comments

@trburgess
Copy link

trburgess commented Jan 21, 2017

The client supports an array of attributes as a second argument to the constructor:

        if (isset($attributes['channel'])) {
            $this->setDefaultChannel($attributes['channel']);
        }
        if (isset($attributes['username'])) {
            $this->setDefaultUsername($attributes['username']);
        }
        if (isset($attributes['icon'])) {
            $this->setDefaultIcon($attributes['icon']);
        }
        if (isset($attributes['link_names'])) {
            $this->setLinkNames($attributes['link_names']);
        }
        if (isset($attributes['unfurl_links'])) {
            $this->setUnfurlLinks($attributes['unfurl_links']);
        }
        if (isset($attributes['unfurl_media'])) {
            $this->setUnfurlMedia($attributes['unfurl_media']);
        }
        if (isset($attributes['allow_markdown'])) {
            $this->setAllowMarkdown($attributes['allow_markdown']);
        }
        if (isset($attributes['markdown_in_attachments'])) {
            $this->setMarkdownInAttachments($attributes['markdown_in_attachments']);
        }

It would be great to be able to define them in the config and then have that passed to the constructor.

I would be happy to submit a PR for this.

@trburgess
Copy link
Author

PR here:
#29

@Anahkiasen
Copy link
Member

Gonna try to find the time to tag a new stable with your fix soon

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

2 participants