Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
cavallium committed Aug 30, 2023
1 parent 652d116 commit 5037157
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/src/main/java/it/tdlight/example/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class Example {

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
Init.init();

Expand Down Expand Up @@ -111,7 +111,7 @@ private static void onUpdateNewMessage(TdApi.UpdateNewMessage update) {
}

// 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
Chat chat = chatIdResult.get();
// Get the chat name
Expand All @@ -133,7 +133,7 @@ public void onCommand(TdApi.Chat chat, TdApi.MessageSender commandSender, String
if (isAdmin(commandSender)) {
// Stop the client
System.out.println("Received stop command. closing...");
client.sendClose();
CLIENT.sendClose();
}
}
}
Expand Down

0 comments on commit 5037157

Please sign in to comment.