首页 > 解决方案 > 如何在 Eclipse 中从 rubenlagus 导入 Telegram Bot API

问题描述

我想开始使用 rubenlagus 的 Telegram Bots Api 5.2.0 对 Telegram Bot 进行编码,但我无法将它导入到我在 Eclipse 中的项目中。

https://github.com/rubenlagus/TelegramBots

我什至不知道 Maven 或 Gradle 是什么,所以我尝试了 4. 建议的选项来导入库,下载并导入了文件 'telegrambots-5.2.0-jar-with-dependencies' 但它不完整并且缺少以下内容类(也许更多,但那些是我尝试使用但找不到的):

org.telegram.telegrambots.bots.TelegramLongPollingBot
org.telegram.telegrambots.bots.TelegramWebhookBot
org.telegram.telegrambots.meta.TelegramBotsApi

那么我需要做什么才能使用 Eclipse 将整个库导入到我的项目中呢?

标签: javaeclipsetelegramtelegram-bot

解决方案


使用Maven :- 尝试在pom.xml文件中导入 maven 依赖项

<dependency>
   <groupId>org.telegram</groupId>
   <artifactId>telegrambots</artifactId>
   <version>5.2.0</version>
</dependency>

使用Gradle:-

implementation 'org.telegram:telegrambots:5.2.0'

推荐阅读