File tree Expand file tree Collapse file tree
example/src/main/java/it/tdlight/example Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,8 +74,15 @@ public static void main(String[] args) throws Exception {
7474
7575 // Create and start the client
7676 try (var app = new ExampleApp (clientBuilder , authenticationData , adminId )) {
77- // Get me
78- TdApi .User me = app .getClient ().getMeAsync ().get (1 , TimeUnit .MINUTES );
77+ // Get me
78+ TdApi .User me = app .getClient ().getMeAsync ().get (1 , TimeUnit .MINUTES );
79+
80+ // Print the bot username so the user knows where to write
81+ if (me .usernames != null && me .usernames .activeUsernames .length > 0 ) {
82+ System .out .println ("Bot ready! Send messages to: @" + me .usernames .activeUsernames [0 ]);
83+ } else {
84+ System .out .println ("Bot ready! User ID: " + me .id );
85+ }
7986
8087 // Create the "saved messages" chat
8188 var savedMessagesChat = app .getClient ().send (new CreatePrivateChat (me .id , true )).get (1 , TimeUnit .MINUTES );
You can’t perform that action at this time.
0 commit comments