rubenlagus / Deepthought

Telegram Client written in Java to support multiple custom implementations
74 stars 41 forks source link

Send a Message to a Telegram User #34

Open chri1389 opened 6 years ago

chri1389 commented 6 years ago

Hello, I have import this project in Eclipse and I have modify the main parameters: APIKEY, APIHASH, PHONENUMBER and the Database MySQL parameters....

The project run well.

Now I have a question.

How can I modify the main class (Deepthought.java) to send a simple message to a specific user?

Thank you very much!

Best Regards

onixred commented 6 years ago

hi, you see my example

IKernelComm kernelComm = kernel.getKernelComm();
final IUser user = databaseManager.getUserById(kernelComm.getCurrentUserId());
if (user != null) {
    kernelComm.sendMessage(user, message);
}
kernelComm.sendMessage(user, message);