telegram-s / telegram-api-old

Telegram Api library for java
MIT License
138 stars 64 forks source link

Incomplete Source Code? #25

Open jinfeei opened 10 years ago

jinfeei commented 10 years ago

Hi, First THANK YOU so much for your excellent Telegram.

When I'm browsing through the source code, I notice that some files are missing, like:

org.telegram.api.auth.TLAuthorization etc.

What has been released is just org.telegram.api.engine, but all the rest under org.telegram.api.* are missing? Or am I missing something?

alexkvak commented 10 years ago

I have the same question

mfeliu commented 10 years ago

I have the the same problem. It seems that there are some classes provided only as byte code in:

https://github.com/ex3ndr/telegram-api/tree/master/libs

It is a problem because the classes in binary form provide incomplete information with respect to the API. Thus, you have limited functionality. For example, I have been able to send and receive text messages with the API but not to download profile photos.

jnitish25 commented 9 years ago

When i build the mtproto individually it runs fine but when i try building the telegram-api folder it gives me a :"could not fine any version that matches com.droidkit:actors:0.2.48+" required by ....>telegram-api:mtproto:unspecified

jnitish25 commented 9 years ago

@mfeliu can you please share your code. I am trying to send a message using telegram API and stuck with the "TimeOu Exceptiont".

mfeliu commented 9 years ago

@jnitish25 the code I wrote was just a small modification of this project

https://github.com/ex3ndr/telegram-bot

Be careful though to download the exact versions (the exact commits) of the libraries linked under the /libraries path of this project.

Good luck!

jnitish25 commented 9 years ago

Ya even i tried the same but Im getting a so called "unknown dispatcher connection error" and when i use d default ootion it gets timedout at RPC call.. Thank u for ur reply.. On Sep 30, 2014 4:33 PM, "mfeliu" notifications@github.com wrote:

@jnitish25 https://github.com/jnitish25 the code I wrote was just a small modification of this project

https://github.com/ex3ndr/telegram-bot

Be careful though to download the exact versions (the exact commits) of the libraries linked under the /libraries path of this project.

Good luck!

— Reply to this email directly or view it on GitHub https://github.com/ex3ndr/telegram-api/issues/25#issuecomment-57297352.

jnitish25 commented 9 years ago

Hey, Please can you help me out with this Telegram issue.I'm really stuck with it for the past 2 weeks.I downloaded the exact versions as well. Thank you. Regards, Nitish

On Tue, Sep 30, 2014 at 4:33 PM, mfeliu notifications@github.com wrote:

@jnitish25 https://github.com/jnitish25 the code I wrote was just a small modification of this project

https://github.com/ex3ndr/telegram-bot

Be careful though to download the exact versions (the exact commits) of the libraries linked under the /libraries path of this project.

Good luck!

— Reply to this email directly or view it on GitHub https://github.com/ex3ndr/telegram-api/issues/25#issuecomment-57297352.

ashokcoolguys commented 9 years ago

Some one plz share samples for sending text messages using this API. I couldn't get any documentations for sending messages

ashokcoolguys commented 9 years ago

@mfeliu ,Can u share some samples on sending text messages using this API. i have authenticated the application,but no clues to move forward.I suppose most of the samples over internet were removed .

alexkvak commented 9 years ago

you need first add recipient to sender's contact list. Then you can create peer with contact and send there a message

ashokcoolguys commented 9 years ago

I already have a few in my contact list..but i don't have method details on adding new/retrieving existing user/chat id...can u share some samples!!

alexkvak commented 9 years ago
val contact = new TLInputContact(1, "087643264", "Alex", "K")

val contacts = new TLVector[TLInputContact]
contacts.add(contact)

val importContacts = new TLRequestContactsImportContacts(contacts, true)
val importedContacts = api.doRpcCall(importContacts)

val recipient = importedContacts.getUsers.get(0)
val peer = new TLInputPeerContact(recipient.getId)

val sendMessageRequest = new TLRequestMessagesSendMessage(peer, sendMessage.messageText, Random.nextLong())

val sentMessage = api.doRpcCall(sendMessageRequest)

There is sample code in Scala. Hope you can read it :)

ashokcoolguys commented 9 years ago

Hi Alex,

thanks for the code.It gives me better idea.

Replicated the same in Java..but I m getting timed out exception while RPC for importContacts..Am I missing something??

     TLInputContact tlic=new TLInputContact(1, PhNo, Fname, Lname);
    TLVector<TLInputContact> contacts = new TLVector<>();
    contacts.add(tlic);
    TLRequestContactsImportContacts importContacts = new

TLRequestContactsImportContacts(contacts, true); * TLImportedContacts importedContacts = api.doRpcCall(importContacts);* TLAbsUser recipient=importedContacts.getUsers().get(0); TLInputPeerContact peer = new TLInputPeerContact(recipient.getId()); TLRequestMessagesSendMessage sendMessageRequest = new TLRequestMessagesSendMessage(peer, "Test", rnd.nextInt()); TLAbsSentMessage sentMessage = api.doRpcCall(sendMessageRequest);

On Mon, Dec 1, 2014 at 8:38 PM, Alex Kvak notifications@github.com wrote:

val contact = new TLInputContact(1, "087643264", "Alex", "K") val contacts = new TLVector[TLInputContact] contacts.add(contact) val importContacts = new TLRequestContactsImportContacts(contacts, true)val importedContacts = api.doRpcCall(importContacts) val recipient = importedContacts.getUsers.get(0)val peer = new TLInputPeerContact(recipient.getId) val sendMessageRequest = new TLRequestMessagesSendMessage(peer, sendMessage.messageText, Random.nextLong()) val sentMessage = api.doRpcCall(sendMessageRequest)

There is sample code in Scala. Hope you can read it :)

— Reply to this email directly or view it on GitHub https://github.com/ex3ndr/telegram-api/issues/25#issuecomment-65077404.