Code Monkey home page Code Monkey logo

php-slack's People

Contributors

brainrepo avatar connorvg avatar cvuorinen avatar darksworm avatar eric-famiglietti avatar slowbro 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

php-slack's Issues

Is this library still maintained?

Looking into the last commit date and comparing this library functionality with the actual Slack API I want to know - if it makes sense to contribute to the library?

Laravel 5 integration

I see you have some Laravel projects so could you make L5 integration for this lib (service provider + facade)?

Unit test?

Hi, I see in the composer file that there is some stuff for unit testing, but I don't see unit test.

Can you add it? If there is not, thanks to say it, so in this way someone can implemetned it.

files.upload doesn't work with '@filename.ext'

Hello,

I found a bug with files.upload. Due to the use of http_build_query() in src/Http/CurlInteractor.php, the '@' before the filename is being urlencoded, causing cURL to not attempt a file upload. I think this can be changed to remove "http_build_query", but I have a feeling that it's there for a reason.

Is there some way this cane be worked around?

    public function post($url, array $urlParameters = [], array $postParameters = [], array $headers = [])
    {
        $request = $this->prepareRequest($url, $urlParameters, $headers);

        curl_setopt($request, CURLOPT_POST, count($postParameters));
        curl_setopt($request, CURLOPT_POSTFIELDS, http_build_query($postParameters));
        # this is the edited line, that makes the request work:
        #curl_setopt($request, CURLOPT_POSTFIELDS, $postParameters);

        return $this->executeRequest($request);
    }

the request used:

        $res = $slack->execute('files.upload', [
            'file' => '@derp.jpg',
            'filename' => 'derp.jpg',
        ]);

response using code in master:

array(3) {
  ["status_code"]=>
  int(200)
  ["headers"]=>
  array(4) {
    ["Host"]=>
    string(9) "slack.com"
    ["Accept"]=>
    string(3) "*/*"
    ["Content-Length"]=>
    string(3) "154"
    ["Content-Type"]=>
    string(33) "application/x-www-form-urlencoded"
  }
  ["body"]=>
  array(2) {
    ["ok"]=>
    bool(false)
    ["error"]=>
    string(12) "no_file_data"
  }
}

expected/response with edited code:

array(3) {
  ["status_code"]=>
  int(200)
  ["headers"]=>
  array(5) {
    ["Host"]=>
    string(9) "slack.com"
    ["Accept"]=>
    string(3) "*/*"
    ["Content-Length"]=>
    string(5) "66013"
    ["Expect"]=>
    string(12) "100-continue"
    ["Content-Type"]=>
    string(70) "multipart/form-data; boundary=----------------------------d5bae95ca2b5"
  }
  ["body"]=>
  array(2) {
    ["ok"]=>
    bool(true)
    ["file"]=>
    array(35) { ... }
  }
}

No simple way to bypass formatting

Needed a quick way stop URL markup from being munged on post. Slack accepts <http://foo.bar|Text Description>, but chat.postMessage always calls Commander::format() for the text block. Simple change to line 465 fixes it:

-        if (isset($command['format']))
+        if (isset($command['format']) and !isset($parameters['no_format']))

how to get the "xoxp-some-token-for-slack"

Ho, in the exemple you speak about "xoxp-some-token-for-slack".
I suppose it's the oauth token? If it's correct, perhaps you should add an explanation about how to add this one (even by using another libs).

Error unfound class.

After i use the example in the readme i get this one:

[Sun Jan 25 20:11:34 2015] PHP Fatal error:  Class 'Frlnc\Slack\Http\CurlInteractor' not found in /Volumes/NIKON D7000/php-slack/index.php on line 7
[Sun Jan 25 20:11:34 2015] ::1:56216 [500]: / - Class 'Frlnc\Slack\Http\CurlInteractor' not found in /Volumes/NIKON D7000/php-slack/index.php on line 7

Class Not Found

Hey,

I'm trying to use this in a small project of mine, but I'm getting
PHP Fatal error: Class 'Frlnc\\Slack\\Http\\CurlInteractor' not found in /path/to/file/calling/new/cur/interactor

I think I may have installed improperly, so for reference, my composer.json is as follows:

{
  "name" : "teltech/q2a-slackbot",
  "keywords" : ["slack", "Q2A"],
  "license" : "MIT",
  "require" : {
    "php" : ">=5.4.0",
    "frlnc/php-slack" : ">=1.0.0"
  }
}

Any advice for fixing this?

Protected arrays

I cannot loop through the history of the messages posted to the channel though I can view all the key-value pairs in the array.

This is my response:
object(Frlnc\Slack\Http\SlackResponse)#6 (3) {
["body":protected]=>
array(3) {
["ok"]=>
bool(true)
["messages"]=>
array(73) {
[0]=>
array(4) {
......

This is the error I get when trying to access the array:

Fatal error: Uncaught Error: Cannot access protected property Frlnc\Slack\Http\SlackResponse::$body in C:\xampp\htdocs\fair\slack.php:37
Stack trace:
#0 {main}

thrown in C:\xampp\htdocs\fair\slack.php on line 37

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.