Closed jaynlive closed 2 years ago
Maybe error in docks. Please, try array:
http://127.0.0.1:9503/api/messages.addChatUser/?data[chat_id]=-587484050&data[user_id]=859166963
Actually docs are correct. Method requires array:
// PHP 8+ syntax, use an array on PHP 7.
$Updates = $MadelineProto->messages->addChatUser(chat_id: InputPeer, user_id: InputUser, fwd_limit: int, );
Maybe error in docks. Please, try array:
http://127.0.0.1:9503/api/messages.addChatUser/?data[chat_id]=-587484050&data[user_id]=859166963
thank you.it is ok.
if i want put some array to the value. how to require? just like this request. https://docs.madelineproto.xyz/API_docs/methods/messages.createChat.html
users key is requre array. i request like
http://127.0.0.1:9503/api/messages.createChat?data[title]=chat_title&data[users]=[@user1,@user2,@user3,etc...]
it return false
"success": false,
"errors": [
{
"exception": "danog\\MadelineProto\\TL\\Exception",
"message": "You didn't provide a valid array",
"file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/TL\/TL.php",
"line": 517,
"code": 0,
"backtrace": [
{
"file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/TL\/TL.php",
"line": 735,
"function": "serializeObject",
"class": "danog\\MadelineProto\\TL\\TL",
"type": "->"
},
{
"file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/TL\/TL.php",
"line": 599,
"function": "serializeParams",
"class": "danog\\MadelineProto\\TL\\TL",
"type": "->"
},
{
"file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/Connection.php",
"line": 510,
"function": "serializeMethod",
"class": "danog\\MadelineProto\\TL\\TL",
"type": "->"
}
]
}
],
"response": null
}
Maybe error in docks. Please, try array:
http://127.0.0.1:9503/api/messages.addChatUser/?data[chat_id]=-587484050&data[user_id]=859166963
thank you.it is ok.
if i want put some array to the value. how to require? just like this request. https://docs.madelineproto.xyz/API_docs/methods/messages.createChat.html
users key is requre array. i request like
http://127.0.0.1:9503/api/messages.createChat?data[title]=chat_title&data[users]=[@user1,@user2,@user3,etc...]
it return false
"success": false, "errors": [ { "exception": "danog\\MadelineProto\\TL\\Exception", "message": "You didn't provide a valid array", "file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/TL\/TL.php", "line": 517, "code": 0, "backtrace": [ { "file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/TL\/TL.php", "line": 735, "function": "serializeObject", "class": "danog\\MadelineProto\\TL\\TL", "type": "->" }, { "file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/TL\/TL.php", "line": 599, "function": "serializeParams", "class": "danog\\MadelineProto\\TL\\TL", "type": "->" }, { "file": "\/www\/wwwroot\/TelegramApiServer-master\/vendor\/danog\/madelineproto\/src\/danog\/MadelineProto\/Connection.php", "line": 510, "function": "serializeMethod", "class": "danog\\MadelineProto\\TL\\TL", "type": "->" } ] } ], "response": null }
ok.i konw how to request. use this work
http://127.0.0.1:9503/api/messages.createChat?data[title]=chat_title&data[users][0]=@user1&data[users][1]=@user2
Readme has some example. I recommend always use http_buil_query to generate correct query.
i request messages.addChatUser method , return false. about method doc: https://docs.madelineproto.xyz/API_docs/methods/messages.addChatUser.html
request url:
http://127.0.0.1:9503/api/messages.addChatUser?chat_id=-587484050&user_id=859166963
orhttp://127.0.0.1:9503/api/messages.addChatUser/?chat_id=-587484050&user_id=859166963
return