public function sendFile(Channel $channel, $filepath, $filename, $content, $tts)
    {
        $multipart = [
            [
                'name'     => 'file',
                'contents' => fopen($filepath, 'r'),
                'filename' => $filename,
            ],
            [
                'name'     => 'tts',
                'contents' => ($tts ? 'true' : 'false'),
            ],
            [
                'name'     => 'content',
                'contents' => (string) $content,
            ],
        ];

        return $this->runRequest(
            'POST',
            "channels/{$channel->id}/messages",
            null,
            [],
            false,
            false,
            ['multipart' => $multipart]
        );
    }
public function sendFile(Channel $channel, $filepath, $filename, $content, $tts)
    {
        $multipart = [
            [
                'name'     => 'file',
                'contents' => fopen($filepath, 'r'),
                'filename' => $filename,
            ],
            [
                'name'     => 'tts',
                'contents' => ($tts ? 'true' : 'false'),
            ],
            [
                'name'     => 'content',
                'contents' => (string) $content,
            ],
        ];

        return $this->runRequest(
            'POST',
            "channels/{$channel->id}/messages",
            null,
            [],
            false,
            false,
            ['multipart' => $multipart]
        );
    }
public function sendFile ( Channel $ channel , $ filepath , $ filename , $ content , $ tts ) { $ multipart = [ [ 'name' => 'file' , 'contents' => fopen ( $ filepath , 'r' ) , 'filename' => $ filename , ] , [ 'name' => 'tts' , 'contents' => ( $ tts ? 'true' : 'false' ) , ] , [ 'name' => 'content' , 'contents' => ( string ) $ content , ] , ] ; return $ this -> runRequest ( 'POST' , "channels/{$channel->id}/messages" , null , [ ] , false , false , [ 'multipart' => $ multipart ] ) ; }
Uploads a file to a channel.

@param Channel $channel  The channel to send to.
@param string  $filepath The path to the file.
@param string  $filename The name to upload the file as.
@param string  $content  Extra text content to go with the file.
@param bool    $tts      Whether the message should be TTS.

@return \React\Promise\Promise
Uploads a file to a channel .