A Java Wrapper for TDLib/TDLight
Go to file
2022-06-14 13:10:06 +02:00
.github/workflows Use TDLib 1.7.10, add BOM, fix null updates, rewrite pom.xml 2021-12-08 02:24:23 +01:00
.media Update README 2021-10-01 19:41:24 +02:00
bom Update tdlib 2022-06-14 13:07:57 +02:00
example Update example 2022-06-14 13:10:06 +02:00
parent Update flatten plugin 2022-05-11 09:46:52 +02:00
scripts Use TDLib 1.7.10, add BOM, fix null updates, rewrite pom.xml 2021-12-08 02:24:23 +01:00
src Fix typo 2022-05-20 10:26:15 +02:00
tdlib Clean pom.xml 2022-05-18 12:58:23 +02:00
tdlight Add m2e support 2022-05-18 12:59:34 +02:00
.editorconfig Code cleanup 2021-10-22 12:54:28 +02:00
.gitignore Update flatten plugin 2022-05-11 09:37:24 +02:00
.gitmodules Move to github actions 2020-12-29 23:38:50 +01:00
jitpack.yml Code cleanup 2021-10-22 12:54:28 +02:00
JTDLIB_LICENSE Rewrite ReadMe 2020-08-20 12:18:04 +02:00
LICENSE Added missing license 2018-11-20 18:51:11 +01:00
README.md Update readme 2021-12-17 16:25:57 +01:00

TDLight logo

TDLight Java

Complete Bot and Userbot Telegram library written in Java, based on TDLib

Java CI Release JProfiler

💻 Supported platforms

Java versions: from Java 8 to Java 17

Operating systems: Linux, Windows, MacOS

CPU architectures:

  • i386/x86 (Linux, Windows)
  • amd64/x86_64 (Linux, Windows, OSX)
  • armhf/armv7 (Linux)
  • aarch64/armv8/arm64 (Linux)
  • s390x (Linux)
  • ppc64el/ppc64le (Linux)

📚 Required libraries

Install OpenSSL on macOS

You must install openssl@3 using the brew package manager , then link openssl to /usr/local/opt/openssl

If you don't know how to do this, type the following commands in your terminal:

brew install openssl@3
ln -sf /usr/local/Cellar/openssl@3/3.0.0 /usr/local/opt/openssl

📚 How to use the library

Setting up the library using Maven

If you are using Maven, edit your pom.xml file as below:


<project>
	<repositories>

		<!-- Add the following repository -->
		<repository>
			<id>mchv</id>
			<name>MCHV Apache Maven Packages</name>
			<url>https://mvn.mchv.eu/repository/mchv/</url>
		</repository>

	</repositories>

	<dependencyManagement>
		<dependencies>
			
			<!-- Add the following dependency -->
			<dependency>
				<groupId>it.tdlight</groupId>
				<artifactId>tdlight-java-bom</artifactId>
				<version>VERSION</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>

		<!-- Add the following dependencies -->
		<dependency>
			<groupId>it.tdlight</groupId>
			<artifactId>tdlight-java</artifactId>
			<!-- don't specify the version here -->
		</dependency>
		<dependency>
			<groupId>it.tdlight</groupId>
			<artifactId>tdlight-natives-linux-amd64</artifactId>
			<!-- don't specify the version here -->
		</dependency>
		<!-- Include other native versions that you want, for example for windows, osx, ... -->

	</dependencies>
</project>

Replace VERSION with the latest release version, you can find it here.

Setting up the library using Gradle

If you are using Gradle, add the following lines into your build.gradle file

repositories {
	maven { url "https://mvn.mchv.eu/repository/mchv/" }
}
dependencies {
	// import the BOM
	implementation platform('it.tdlight:tdlight-java-bom:VERSION')

	// do not specify the versions on the dependencies below!
	implementation 'it.tdlight:tdlight-java'
	implementation 'it.tdlight:tdlight-natives-linux-amd64'
	// Include other native versions that you want, for example for windows, osx, ...
}

Replace VERSION with the latest release version, you can find it here.

âš’ Native dependencies

To use TDLight Java you need to include one or more native dependencies:

  • tdlight-natives-linux-amd64
  • tdlight-natives-linux-aarch64
  • tdlight-natives-linux-x86
  • tdlight-natives-linux-armhf
  • tdlight-natives-linux-ppc64le
  • tdlight-natives-linux-s390x
  • tdlight-natives-windows-amd64
  • tdlight-natives-osx-amd64

Usage

An example on how to use TDLight Java can be found here: Example.java

Advanced usage

If you want to disable the automatic runtime shutdown hook, you should set the property it.tdlight.enableShutdownHooks to false

TDLight methods documentation

TdApi JavaDoc

TDLight extended features

TDLight has some extended features compared to TDLib, that you can see on the TDLight official repository.

About

License

TDLight is licensed by Andrea Cavalli andrea@cavallium.it under the terms of the GNU Lesser General Public License 3

Libraries licenses

JTDLib is licensed by Ernesto Castellotti erny.castell@gmail.com under the terms of the GNU Lesser General Public License 3

TDLib is licensed by Aliaksei Levin levlam@telegram.org and Arseny Smirnov arseny30@gmail.com under the terms of the Boost Software License

OpenSSL is licensed under the terms of Apache License v2

Zlib is licensed under the terms of Zlib license