Giter Club home page Giter Club logo

Comments (9)

moznion avatar moznion commented on August 16, 2024

Could you use "\n" instead of '\n'?

from line-bot-sdk-php.

rebornishard avatar rebornishard commented on August 16, 2024

@moznion sry my last reply not posted, error in my internet connection
"\n"
worked like a charm

is there any clue for new bubble ?
let me try call replyText twice

thank you

from line-bot-sdk-php.

moznion avatar moznion commented on August 16, 2024

@rebornishard
You can reply multi messages up to 5 (please see: https://devdocs.line.me/en/#reply-message).
This SDK provides helper method to do that. Please refer MultiMessageBuilder.

from line-bot-sdk-php.

rebornishard avatar rebornishard commented on August 16, 2024

thanks, gotten into that,
i tried with it and fail,
but worked on dev acc
another one fail in TextMessageBuilder

i use this :

$textMessageBuilder = new \LINE\LINEBot\MessageBuilder\TextMessageBuilder('hello');
$response = $bot->replyMessage('<reply token>', $textMessageBuilder);
if ($response->isSucceeded()) {
    echo 'Succeeded!';
    return;
}

// Failed
echo $response->getHTTPStatus . ' ' . $response->getRawBody();

result :

object(LINE\LINEBot\Response)#184 (3) {
  ["httpStatus":"LINE\LINEBot\Response":private]=>
  int(400)
  ["body":"LINE\LINEBot\Response":private]=>
  string(100) "{"message":"The property, 'messages[0].text', in the request body is invalid (line: 1, column: 84)"}"
  ["headers":"LINE\LINEBot\Response":private]=>
  array(12) {
    ["Server"]=>
    string(5) "nginx"
    ["Content-Type"]=>
    string(30) "application/json;charset=UTF-8"
    ["X-Line-Request-Id"]=>
    string(36) "70ed586b-7734-4aa6-ab34-322681aeb4d3"
    ["X-Content-Type-Options"]=>
    string(7) "nosniff"
    ["X-XSS-Protection"]=>
    string(13) "1; mode=block"
    ["X-Frame-Options"]=>
    string(4) "DENY"
    ["Content-Length"]=>
    string(3) "100"
    ["Expires"]=>
    string(29) "Thu, 02 Feb 2017 18:43:37 GMT"
    ["Cache-Control"]=>
    string(29) "max-age=0, no-cache, no-store"
    ["Pragma"]=>
    string(8) "no-cache"
    ["Date"]=>
    string(29) "Thu, 02 Feb 2017 18:43:37 GMT"
    ["Connection"]=>
    string(5) "close"
  }
}

where i can found this one :

string(100) "{"message":"The property, 'messages[0].text', in the request body is invalid (line: 1, column: 84)"}"

i can do it well using simple mode :

$response = $bot->replyText('<reply token>', 'hello!');

i do it like this :

$messageD = data['message'];
$textMessageBuilder = new \LINE\LINEBot\MessageBuilder\TextMessageBuilder($messageD);
$response = $bot->replyMessage('<reply token>', $textMessageBuilder);
if ($response->isSucceeded()) {
    echo 'Succeeded!';
    return;
}

// Failed
echo $response->getHTTPStatus . ' ' . $response->getRawBody();

this on isn't worked, but :

$messageD = $data['message'];
$response = $bot->replyText('<reply token>', $messageD);

running so well

What I already did

  1. Create New Subdomain -- fail, same error

  2. Apply it on different server -- fail, same error

thank you

here from another server :

object(LINE\LINEBot\Response)#177 (3) {
  ["httpStatus":"LINE\LINEBot\Response":private]=>
  int(400)
  ["body":"LINE\LINEBot\Response":private]=>
  string(100) "{"message":"The property, 'messages[0].text', in the request body is invalid (line: 1, column: 84)"}"
  ["headers":"LINE\LINEBot\Response":private]=>
  array(12) {
    ["Server"]=>
    string(5) "nginx"
    ["Date"]=>
    string(29) "Thu, 02 Feb 2017 23:44:42 GMT"
    ["Content-Type"]=>
    string(30) "application/json;charset=UTF-8"
    ["Transfer-Encoding"]=>
    string(7) "chunked"
    ["Connection"]=>
    string(10) "keep-alive"
    ["X-Line-Request-Id"]=>
    string(36) "32d3c627-5174-47a3-92d2-c21c326c0cc9"
    ["X-Content-Type-Options"]=>
    string(7) "nosniff"
    ["X-XSS-Protection"]=>
    string(13) "1; mode=block"
    ["Cache-Control"]=>
    string(46) "no-cache, no-store, max-age=0, must-revalidate"
    ["Pragma"]=>
    string(8) "no-cache"
    ["Expires"]=>
    string(1) "0"
    ["X-Frame-Options"]=>
    string(4) "DENY"
  }
}

from line-bot-sdk-php.

moznion avatar moznion commented on August 16, 2024

@rebornishard
I could not reproduce this problem. Could you show us more details?

from line-bot-sdk-php.

moznion avatar moznion commented on August 16, 2024

@rebornishard If there is no reply within one week, this issue will be closed.

from line-bot-sdk-php.

rebornishard avatar rebornishard commented on August 16, 2024

@moznion i use webhook from my other project and worked,
sry for late reply i must rebuild it from scratch, no problem after running it for 3 days

and now i want to try MultiMessageBuilder

can i use it like this

text
image
text
audio
text

with MultiMessageBuilder ?

thank you @moznion

from line-bot-sdk-php.

moznion avatar moznion commented on August 16, 2024

Please refer: https://github.com/line/line-bot-sdk-php/blob/e16d9ca/tests/LINEBot/SendMultiMessageTest.php#L80

from line-bot-sdk-php.

moznion avatar moznion commented on August 16, 2024

And please refer to the wiki page: https://github.com/line/line-bot-sdk-php/wiki/Sending-multiple-messages

from line-bot-sdk-php.

Related Issues (20)

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.