1
0
forked from ErnyTech/JTDLib
This repository has been archived on 2020-08-18. You can view files and clone it, but cannot push or open issues or pull requests.
JTDLib/src/main/java/it/ernytech/tdbot/BotClient.java
Ernesto Castellotti f8e0f352c3 Implemented new checks in authorizationHandler for check if bot token, phone number, code or password are invalid
Added password hint in password authorization

Check if EasyClient has the authorization before send request

Optimized execute in EasyClient

Implemented close and open for logout from TDLib e re-login

Now client can execute auto, just set logoutAtShutdown to true in initializer

Fix https://github.com/ErnyTech/JTDLib/issues/5
2018-11-19 17:59:57 +01:00

35 lines
1.1 KiB
Java

/*
* Copyright (c) 2018. Ernesto Castellotti <erny.castell@gmail.com>
* This file is part of JTdlib.
*
* JTdlib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* JTdlib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JTdlib. If not, see <http://www.gnu.org/licenses/>.
*/
package it.ernytech.tdbot;
import it.ernytech.tdlib.TdApi;
/**
* Interface for easy interaction with TDLib for bot.
*/
public class BotClient extends EasyClient {
/**
* Creates a new BotClient
* @param botToken The bot token generated with t.me/BotFather
*/
public BotClient(String botToken) {
super(easyClient -> easyClient.sendRaw(new TdApi.CheckAuthenticationBotToken(botToken)));
}
}