Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not work addContact #1213

Closed
MahdiBagheri71 opened this issue Aug 30, 2022 · 4 comments
Closed

not work addContact #1213

MahdiBagheri71 opened this issue Aug 30, 2022 · 4 comments

Comments

@MahdiBagheri71
Copy link

Not Work addContact :

$inputPhoneContact = ['phone' => '+989397661471', 'first_name' => 'mahdi', 'last_name' => 'bagheri']; $Updates = $MadelineProto->contacts->addContact($inputPhoneContact);

@danog
Copy link
Owner

danog commented Aug 30, 2022

You need importContacts for that

@danog danog closed this as completed Aug 30, 2022
@MahdiBagheri71
Copy link
Author

log :

Logger: MadelineProto
Logger: Copyright (C) 2016-2022 Daniil Gentili
Logger: Licensed under AGPLv3
Logger: https://github.com/danog/MadelineProto
Serialization: MadelineProto is starting, please wait...
Serialization: Connected to IPC socket!
API: Shutting down MadelineProto (danog\MadelineProto\API)
API: Prompting final serialization...
API: Done final serialization!
Logger: MadelineProto
Logger: Copyright (C) 2016-2022 Daniil Gentili
Logger: Licensed under AGPLv3
Logger: https://github.com/danog/MadelineProto
Serialization: MadelineProto is starting, please wait...
Serialization: Connected to IPC socket!
Exception: Telegram returned an RPC error: The provided contact ID is invalid (400) (CONTACT_ID_INVALID), caused by phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/danog/madelineproto/src/danog/MadelineProto/Ipc/ExitFailure.php:48

TLtrace:
Client.php(237): __call("methodCallAsyncRead",["contacts.addContact",{"phone":"+989130112406","first_name":"mahdi","last_name":"bagheri"},{"apifactory":true}])
AbstractAPIFactory.php(186): methodCallAsyncRead("contacts.addContact",{"phone":"+989130112406","first_name":"mahdi","last_name":"bagheri"},{"apifactory":true})
__call_async()

Previous TL trace:

['contacts.addContact']
CallHandler.php(59): methodCallAsyncRead("contacts.addContact",{"phone":"+989130112406","first_name":"mahdi","last_name":"bagheri"},{"apifactory":true})
Server.php(253): methodCallAsyncRead("contacts.addContact",{"phone":"+989130112406","first_name":"mahdi","last_name":"bagheri"},{"apifactory":true})
clientRequest()

Previous TL trace:
['contacts.addContact']
ResponseHandler.php(192): handleRpcError()
ResponseHandler.php(70): handleResponse()
Driver.php(102): handleMessages()
Driver.php(61): tick()
Loop.php(90): run()
Tools.php(291): run()
entry.php(99): wait()
entry.php(122): {closure}()
madeline.php(183): require_once("phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/danog/madelineproto/src/danog/MadelineProto/Ipc/Runner/entry.php")
madeline.php(234): load()
madeline.php(269): install()

MTProto: Prompting final serialization (SHUTDOWN)...
MTProto: Done final serialization (SHUTDOWN)!
API: Shutting down MadelineProto (danog\MadelineProto\API)
ClientAbstract: Got exception while receiving in IPC client: Amp\Ipc\Sync\ChannelException: The channel closed unexpectedly. Did the context die? in phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/phabel-transpiler74.danog/ipc/lib/Sync/ChannelledStream.php:64
Stack trace:
#0 [internal function]: Amp\Ipc\Sync\ChannelledStream->Amp\Ipc\Sync{closure}()
#1 phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/phabel-transpiler74.amphp/amp/lib/Coroutine.php(95): Generator->send()
#2 phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/phabel-transpiler74.amphp/amp/lib/Internal/Placeholder.php(128): Amp\Coroutine->Amp{closure}()
#3 phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/phabel-transpiler74.amphp/amp/lib/Deferred.php(52): class@anonymous->resolve()
#4 phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/phabel-transpiler74.amphp/byte-stream/lib/ResourceInputStream.php(158): Amp\Deferred->resolve()
#5 phar:///home/frb191257/domains/mehdibagherivar.freehost.io/public_html/telegram/madeline-fcded0a0eb4189883b99a0dedf34112e49e539e3-74.phar/vendor/phabel-transpiler74.amphp/byte-stream/lib/ResourceInputStream.php(213): Amp\ByteStream\ResourceInputStream->free()
#6 [internal function]: Amp\ByteStream\ResourceInputStream->__destruct()
#7 {main}

@MahdiBagheri71
Copy link
Author

importContacts Not Work !

@MahdiBagheri71
Copy link
Author

MahdiBagheri71 commented Aug 30, 2022

sample :
$inputPhoneContact = ['_' => 'inputPhoneContact', 'phone' => '+989130112406', 'first_name' => 'mahdi', 'last_name' => 'bagheri'];
$contacts_ImportedContacts = $MadelineProto->contacts->importContacts(['contacts' => [$inputPhoneContact], ]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants