update example

This commit is contained in:
Andrea Cavalli 2023-08-30 13:03:00 +02:00
parent 652d116ad9
commit 5037157ba4

View File

@ -32,7 +32,7 @@ public final class Example {
private static SimpleTelegramClient CLIENT; private static SimpleTelegramClient CLIENT;
public static void main(String[] args) throws UnsupportedNativeLibraryException, InterruptedException { public static void main(String[] args) throws Exception {
// Initialize TDLight native libraries // Initialize TDLight native libraries
Init.init(); Init.init();
@ -111,7 +111,7 @@ public final class Example {
} }
// Get the chat title // Get the chat title
client.send(new TdApi.GetChat(update.message.chatId), chatIdResult -> { CLIENT.send(new TdApi.GetChat(update.message.chatId), chatIdResult -> {
// Get the chat response // Get the chat response
Chat chat = chatIdResult.get(); Chat chat = chatIdResult.get();
// Get the chat name // Get the chat name
@ -133,7 +133,7 @@ public final class Example {
if (isAdmin(commandSender)) { if (isAdmin(commandSender)) {
// Stop the client // Stop the client
System.out.println("Received stop command. closing..."); System.out.println("Received stop command. closing...");
client.sendClose(); CLIENT.sendClose();
} }
} }
} }