Giter Club home page Giter Club logo

slack's People

Contributors

4c0n avatar anahkiasen avatar balazscsaba2006 avatar drewbroadley avatar freekmurze avatar georgecoca avatar iwiznia avatar jerome1337 avatar jwcobb avatar maknz avatar mbabker avatar mvatansever avatar nyholm avatar qmcree avatar rajabishek avatar rap2hpoutre avatar rbaarsma avatar soullivaneuh avatar stefanzweifel avatar tzookb avatar vysinsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

slack's Issues

Nothing shows up on slack, no indication of error (and seemingly no way to check for errors/debug?)

Tried this way and the same way as your readme (chained with ->from()->to()->send('hi'))

$client = new Client($slack['endpoint'], [
            'username'=>'CRM',
            'channel'=>'#activity'
        ]);

        $msg = $client->createMessage();
        $msg->from($username);
        $msg->to('#'.$channel);
        $msg->withIcon($emoji);
       $client->sendMessage($msg);

I assume something is working because there's no error, but nothing shows up on slack. I'm verified my endpoint twice and can't figure out what's wrong. Any ideas?

Here's what I get when I var_dump the client after sending the message:

object(Nexy\Slack\Client)#2856 (2) {
["options":"Nexy\Slack\Client":private]=> array(8) {
["channel"]=> string(9) "#activity"
["username"]=> string(3) "CRM"
["icon"]=> NULL 
["link_names"]=> bool(false)
["unfurl_links"]=> bool(false)
["unfurl_media"]=> bool(true)
["allow_markdown"]=> bool(true)
["markdown_in_attachments"]=> array(0) { }
}
["httpClient":"Nexy\Slack\Client":private]=> object(Http\Client\Common\HttpMethodsClient)#2866 (2) {
["httpClient":"Http\Client\Common\HttpMethodsClient":private]=> object(Http\Client\Common\PluginClient)#2869 (3) {
["client":"Http\Client\Common\PluginClient":private]=> object(Http\Adapter\Guzzle6\Client)#2874 (1) {
["client":"Http\Adapter\Guzzle6\Client":private]=> object(GuzzleHttp\Client)#2870 (1) {
["config":"GuzzleHttp\Client":private]=> array(7) {
["handler"]=> object(GuzzleHttp\HandlerStack)#2862 (3) {
["handler":"GuzzleHttp\HandlerStack":private]=> object(Closure)#2864 (2) {
["static"]=> array(2) {
["default"]=> object(Closure)#2875 (2) {
["static"]=> array(2) {
["default"]=> object(GuzzleHttp\Handler\CurlMultiHandler)#2873 (5) {
["factory":"GuzzleHttp\Handler\CurlMultiHandler":private]=> object(GuzzleHttp\Handler\CurlFactory)#2863 (2) {
["handles":"GuzzleHttp\Handler\CurlFactory":private]=> array(0) { }
["maxHandles":"GuzzleHttp\Handler\CurlFactory":private]=> int(50) }
["selectTimeout":"GuzzleHttp\Handler\CurlMultiHandler":private]=> int(1)
["active":"GuzzleHttp\Handler\CurlMultiHandler":private]=> NULL 
["handles":"GuzzleHttp\Handler\CurlMultiHandler":private]=> array(0) { }
["delays":"GuzzleHttp\Handler\CurlMultiHandler":private]=> array(0) { }
}
["sync"]=> object(GuzzleHttp\Handler\CurlHandler)#2867 (1) {
["factory":"GuzzleHttp\Handler\CurlHandler":private]=> object(GuzzleHttp\Handler\CurlFactory)#2858 (2) {
["handles":"GuzzleHttp\Handler\CurlFactory":private]=> array(0) { }
["maxHandles":"GuzzleHttp\Handler\CurlFactory":private]=> int(3) }
}
}
["parameter"]=> array(2) {
["$request"]=> string(10) ""
["$options"]=> string(10) "" }
}
["streaming"]=> object(GuzzleHttp\Handler\StreamHandler)#2871 (1) {
["lastHeaders":"GuzzleHttp\Handler\StreamHandler":private]=> array(0) { }
}
}
["parameter"]=> array(2) {
["$request"]=> string(10) ""
["$options"]=> string(10) "" }
}
["stack":"GuzzleHttp\HandlerStack":private]=> array(1) {
[0]=> array(2) {
[0]=> object(Closure)#2853 (1) {
["parameter"]=> array(1) {
["$handler"]=> string(10) "" }
} [1]=> string(12) "prepare_body" }
}
["cached":"GuzzleHttp\HandlerStack":private]=> NULL }
["allow_redirects"]=> array(5) {
["max"]=> int(5)
["protocols"]=> array(2) {
[0]=> string(4) "http" [1]=> string(5) "https" }
["strict"]=> bool(false)
["referer"]=> bool(false)
["track_redirects"]=> bool(false) }
["http_errors"]=> bool(true)
["decode_content"]=> bool(true)
["verify"]=> bool(true)
["cookies"]=> bool(false)
["headers"]=> array(1) {
["User-Agent"]=> string(69) "GuzzleHttp/6.3.3 curl/7.47.0 PHP/7.2.8-1+ubuntu16.04.1+deb.sury.org+1" }
}
}
}
["plugins":"Http\Client\Common\PluginClient":private]=> array(1) {
[0]=> object(Http\Client\Common\Plugin\BaseUriPlugin)#2855 (2) {
["addHostPlugin":"Http\Client\Common\Plugin\BaseUriPlugin":private]=> object(Http\Client\Common\Plugin\AddHostPlugin)#2897 (2) {
["host":"Http\Client\Common\Plugin\AddHostPlugin":private]=> object(GuzzleHttp\Psr7\Uri)#2898 (7) {
["scheme":"GuzzleHttp\Psr7\Uri":private]=> string(5) "https"
["userInfo":"GuzzleHttp\Psr7\Uri":private]=> string(0) ""
["host":"GuzzleHttp\Psr7\Uri":private]=> string(15) "hooks.slack.com"
["port":"GuzzleHttp\Psr7\Uri":private]=> NULL 
["path":"GuzzleHttp\Psr7\Uri":private]=> string(54) "/services/{{____INFO_HERE_IS_PROBABLY_A_SECURITY_CONCERN_SO_IM_HIDING____}}"
["query":"GuzzleHttp\Psr7\Uri":private]=> string(0) ""
["fragment":"GuzzleHttp\Psr7\Uri":private]=> string(0) "" }
["replace":"Http\Client\Common\Plugin\AddHostPlugin":private]=> bool(false) }
["addPathPlugin":"Http\Client\Common\Plugin\BaseUriPlugin":private]=> object(Http\Client\Common\Plugin\AddPathPlugin)#2896 (1) {
["uri":"Http\Client\Common\Plugin\AddPathPlugin":private]=> object(GuzzleHttp\Psr7\Uri)#2898 (7) {
["scheme":"GuzzleHttp\Psr7\Uri":private]=> string(5) "https"
["userInfo":"GuzzleHttp\Psr7\Uri":private]=> string(0) ""
["host":"GuzzleHttp\Psr7\Uri":private]=> string(15) "hooks.slack.com"
["port":"GuzzleHttp\Psr7\Uri":private]=> NULL 
["path":"GuzzleHttp\Psr7\Uri":private]=> string(54) "/services/{{____INFO_HERE_IS_PROBABLY_A_SECURITY_CONCERN_SO_IM_HIDING____}}"
["query":"GuzzleHttp\Psr7\Uri":private]=> string(0) ""
["fragment":"GuzzleHttp\Psr7\Uri":private]=> string(0) "" }
}
}
}
["options":"Http\Client\Common\PluginClient":private]=> array(2) {
["max_restarts"]=> int(10)
["debug_plugins"]=> array(0) { }
}
}
["requestFactory":"Http\Client\Common\HttpMethodsClient":private]=> object(Http\Message\MessageFactory\GuzzleMessageFactory)#2889 (0) { }
}
}

Using multiple channels

How can I use the select channel feature when I have to select only 1 channel when creating a webhook?

PHP 8 support

Requirements state PHP 7.3+, but currently only 7.3 or 7.4 is supported.

Rewamp some constructors

Move array constructors to real parameters (or option resolver) for following classes:

  • ActionConfirmation
  • Attachment
  • AttachmentAction
  • AttachmentField

Update the doc accordingly.

Return ResponseInterface in sendMessage method

I can make a PR myself, would you like to merge it?
Need to get sent message's ID, so I can later start a thread using that ID. That's kind of essential. Wouldn't break back compatibility. That's it to say, I have a better way - not gonna expose raw ResponseInterface outside

Bump to PHP 7.3

As minimum requirement. BC break are allowed as we will release a new major soon.

php-http/client-implementation package removed.

php-http/client-implementation package removed.
Please change alternatives.

Command output:

Problem 1
- Installation request for nexylan/slack ^2.0 -> satisfiable by nexylan/slack[v2.0.0].
- nexylan/slack v2.0.0 requires php-http/client-implementation ^1.0 -> no matching package found.

Composer lint

New requirement notation, package sort, suggest message simplification...

Require sllh/composer-lint on Travis.

Object of class Nexy\Slack\Client could not be converted to string

I have trouble sending a message on SF4.

Could you please give me an advice?

SlackController.php

$form = $this->createForm(FormType::class);
$form->handleRequest($request);
    if ($form->isSubmitted() && $form->isValid()) {
        $data = $form->getData();
        $slack = $this->get('nexy_slack.client');
        $message = $slack->createMessage();
        $message
            ->from($data['from'])
            ->to('#general')
            ->withIcon(':ghost:')
            ->setText($data['message'])
        ;

        return $client->$slack->sendMessage($message);
    }

return $this->render('app/contact/slack.html.twig', array(
    "locale" => $locale,
    "form" => $form->createView(),
));

ErrorException

Catchable Fatal Error: Object of class Nexy\Slack\Client could not be converted to string

Change to MIT license confirmation

After the discussion in maknz/slack#95 with @maknz, he would like an approbation of all the contributors to confirm the LICENSE change made on v2.0 of this library.

I already did the change because to me, making a new major is enough, as it was done for swift-mailer. It seems not for many people and I'm OK with that.

However, I need an explicit "YES" from each person who has contributed code. Is everyone okay with this?

Of course, if somebody does not want the change, the LICENSE would go back to the v1 one.

Use Symfony options resolver

To simplify options management.

We may consider removing the setters if they can't be used by the resolver.

โš ๏ธ use the ^3.4 version to have array validation (symfony/symfony#15524).

โš ๏ธ Take care of default option provided by Client::createMessage. Find a way to pass them directly to the resolver.

Composer update fails

Using command:

 composer require nexylan/slack php-http/guzzle6-adapter

Gets this:

  Problem 1
    - Conclusion: don't install nexylan/slack 2.x-dev
    - Installation request for php-http/guzzle6-adapter ^2.0@dev -> satisfiable by php-http/guzzle6-adapter[2.x-dev, v2.0.0].
    - Installation request for nexylan/slack ^2.0@dev -> satisfiable by nexylan/slack[2.x-dev, v2.0.0].
    - nexylan/slack v2.0.0 requires php-http/client-common ^1.7 -> satisfiable by php-http/client-common[1.7.0, 1.8.0, 1.8.1, 1.8.x-dev].
    - php-http/client-common 1.7.0 requires php-http/httplug ^1.1 -> satisfiable by php-http/httplug[v1.1.0].
    - php-http/client-common 1.8.0 requires php-http/httplug ^1.1 -> satisfiable by php-http/httplug[v1.1.0].
    - php-http/client-common 1.8.1 requires php-http/httplug ^1.1 -> satisfiable by php-http/httplug[v1.1.0].
    - php-http/client-common 1.8.x-dev requires php-http/httplug ^1.1 -> satisfiable by php-http/httplug[v1.1.0].
    - Conclusion: don't install php-http/httplug v1.1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.