简体   繁体   中英

send message from android telegram source to to specific user id

I want to know, how can i send a message (for ex: text) from owner client to some body's id with coding(dynamically)in android telegram source? what is that method?and objects? if i want explain more i mean send message (to specific user id )from one of telegram source classes. here is telegram source GitHub take look on it(the bad point is, it haven't any comment)

these classes may help to find it, but i cant figure it out

MessageObject.java
TLRPC.Message.java
ChatAttachAlert.java
SendMessagesHelper.java
ChatActivity.java

thanks.

you should use something like this method: SendMessagesHelper.getInstance().sendMessage(). note that it's a network call and you should call it in a thread other than ui thread.

simplest way to send a message is like calling:

   SendMessagesHelper.getInstance().sendMessage("Hi there", to_user_id, null, null, false, null, null, null); 

There are different types of messages and different ways to use this function. if you want to find out how to send other types of messages, search the java codes directory for "sendmessageshelper" and find how the sendMessage function is used in them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM