第 145 章 Telegram
支持生成者和消费者
Telegram 组件提供对 Telegram Bot API 的访问。它允许基于 Camel 的应用程序通过充当 Bot 来发送和接收消息,并参与与普通用户、私有和公共组或频道直接对话。
在使用此组件之前,必须按照 Telegram Bot 开发人员家中的说明创建 Telegram Bot。创建新 Bot 时,B owtFather 提供与 Bot 对应的 授权令牌。授权令牌是 camel-telegram 端点的强制参数。
注意
为了允许 Bot 接收在组或频道内交换的所有消息(不仅仅是以 '/' 字符开头),请 BotFather 使用 /setprivacy 命令禁用隐私模式。
145.1. 依赖项
当在 Red Hat build of Camel Spring Boot 中使用 telegram
时,请确保使用以下 Maven 依赖项来支持自动配置:
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-telegram-starter</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-telegram-starter</artifactId>
</dependency>