Comments (7)
I think firstly you should try to createPrivateChat
(https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1create_private_chat.html) which would return chat object, in which you should try to send message
from phptdlib.
hello @yaroslavche
Thank you very much for your prompt reply.
Okay, I'm going to try it and then I comment on how it went for me.
again thank you very much for the information.
and sorry for the inconvenience caused.
Regards.
from phptdlib.
methods (which need query
or execute
, for example createPrivateChat
)
objects (which you can receive in response, f.e. chat
)
from phptdlib.
hello @yaroslavche
This is to comment that the test was 100% satisfactory
I want to thank you again for the help.
I comment here on my flow to see what you think and if you could give me some other tips
Mr the flow is as follows:
I have the phone number +584241214241
I import the contact with importContacts
if it returns 0 that person does not have a telegram.
If it returns an integer then that person does have a telegram and it returns the user_id of the contact.
I call all contacts with getContacts
Then I add the contact with its user_id with addContact
I call all the contacts again with getContacts
-> I do not understand exactly why this step should be performed (It is something like to update the DB) -> but performing that step the complete flow works for me.
I create a private chat with the user_id with createPrivateChat
When I create a private chat it returns the chat_id
and finally I send the message with the chat_id with sendMessage
Thank you very much again for your support.
Regards.
from phptdlib.
Looks correct to me, but this is not means, that it actually is. I don't really know all nuances, since I'm not using tdlib. Maybe i would just change one thing (if this is possible): remove importContacts
query. Firstly check if contact by phone number exists, and if not, then addContact
.
from phptdlib.
Hi @yaroslavche
ok ok thanks.
Sorry if you are not using tdLib to use the telegram API that another library is using.?
and personally I did not find a way to verify if a contact exists within telegram.
Greetings.
from phptdlib.
hello @yaroslavche This is to comment that the test was 100% satisfactory I want to thank you again for the help. I comment here on my flow to see what you think and if you could give me some other tips
Mr the flow is as follows:
I have the phone number +584241214241 I import the contact with
importContacts
if it returns 0 that person does not have a telegram. If it returns an integer then that person does have a telegram and it returns the user_id of the contact. I call all contacts withgetContacts
Then I add the contact with its user_id withaddContact
I call all the contacts again withgetContacts
-> I do not understand exactly why this step should be performed (It is something like to update the DB) -> but performing that step the complete flow works for me. I create a private chat with the user_id withcreatePrivateChat
When I create a private chat it returns the chat_id and finally I send the message with the chat_id withsendMessage
Thank you very much again for your support.
Regards.
Hi, could you share a piece of code for this procedure with TdApi?
from phptdlib.
Related Issues (20)
- /usr/include/phpcpp/throwable.h:29:1: error: expected class-name before ‘{’ token HOT 3
- Valid api_id must be provided. Can be obtained at https://my.telegram.org HOT 4
- SendMessage Issue HOT 4
- What is the problem?The server system is centos7
- Setup on WIndows 10 HOT 1
- How do I upgrade tdlib from version 1.8.10 to the latest 1.8.25? HOT 6
- more example HOT 1
- TDApi and TDLib not visible on PHP HOT 13
- TdConfig.cmake version: unknown HOT 13
- Please add example callback definition on new message event HOT 1
- Error while cmake HOT 1
- how to add a contact with phptdlib? HOT 4
- how to integrate phptdlib in laravel HOT 1
- importContacts causes an error HOT 4
- how to accept terms of service in authorizationStateWaitRegistration? HOT 4
- Migrate from Travis CI to Github Actions
- setAuthenticationPhoneNumber Verify phone number timed out HOT 8
- Compile error on MessagesManager.cpp.o HOT 2
- Fatal error when git cloning this repo (submodules): "The unauthenticated git protocol on port 9418 is no longer supported."
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phptdlib.