MCPcopy
hub / github.com/rubenlagus/TelegramBots

github.com/rubenlagus/TelegramBots @v10.0.0 sqlite

repository ↗ · DeepWiki ↗ · release v10.0.0 ↗
3,114 symbols 14,842 edges 709 files 776 documented · 25%
README

Telegram Bot Java Library

Telegram

Build Status Jitpack Maven Central MIT License

A simple to use library to create Telegram Bots in Java

Contributions

Feel free to fork this project, work on it and then make a pull request against DEV branch. Most of the times I will accept them if they add something valuable to the code.

Please, DO NOT PUSH ANY TOKEN OR API KEY, I will never accept a pull request with that content.

Webhooks vs GetUpdates

Both ways are supported, but I recommend long polling method.

Usage

For more information, check our documentation

Example bots

Open them and send them /help command to get some information about their capabilities:

https://telegram.me/weatherbot (Use custom keyboards)

https://telegram.me/directionsbot (Basic messages)

https://telegram.me/filesbot (Send files by file_id)

https://telegram.me/TGlanguagesbot (Send files uploding them)

https://telegram.me/RaeBot (Inline support)

https://telegram.me/SnowcrashBot (Webhook support)

You can see code for those bots at TelegramBotsExample project.

Telegram Bot API

This library use Telegram bot API, you can find more information following the link.

Questions or Suggestions

Feel free to create issues here as you need or join the chat

Powered by Intellij and DigitalOcean

DigitalOcean Referral Badge

License

MIT License

Copyright (c) 2016 Ruben Bermudez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Extension points exported contracts — how you extend this code

ICommandRegistry (Interface)
This Interface represents the gateway for registering and deregistering commands. @author Timo Schulz (Mit0x2) [6 implementers]
telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/ICommandRegistry.java
ReactionType (Interface)
@author Ruben Bermudez @version 7.0 This object describes the type of reaction. [36 implementers]
telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionType.java
AbilityToggle (Interface)
This interface can be used to toggle or customize unwanted default abilities by the user. [6 implementers]
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/toggle/AbilityToggle.java
LongPollingSingleThreadUpdateConsumer (Interface)
(no doc) [5 implementers]
telegrambots-longpolling/src/main/java/org/telegram/telegrambots/longpolling/util/LongPollingSingleThreadUpdateConsumer.java
TelegramWebhookBot (Interface)
(no doc) [3 implementers]
telegrambots-webhook/src/main/java/org/telegram/telegrambots/webhook/TelegramWebhookBot.java
ThrowingConsumer (Interface)
Special type of Consumer that may throw a checked exception defined by parameter E
telegrambots-client-jetty-adapter/src/main/java/org/telegram/telegrambots/client/ThrowingConsumer.java
SpringLongPollingBot (Interface)
(no doc) [2 implementers]
telegrambots-springboot-longpolling-starter/src/main/java/org/telegram/telegrambots/longpolling/starter/SpringLongPollingBot.java
ThrowingConsumer (Interface)
Special type of Consumer that may throw a checked exception defined by parameter E
telegrambots-client/src/main/java/org/telegram/telegrambots/client/ThrowingConsumer.java

Core symbols most depended-on inside this repo

builder
called by 532
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/objects/Ability.java
build
called by 510
telegrambots-client/src/main/java/org/telegram/telegrambots/client/TelegramMultipartBuilder.java
validate
called by 232
telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/Validable.java
toString
called by 191
telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ActionType.java
get
called by 176
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/db/Var.java
addPart
called by 118
telegrambots-client-jetty-adapter/src/main/java/org/telegram/telegrambots/client/jetty/JettyMultipartBuilder.java
addPart
called by 114
telegrambots-client/src/main/java/org/telegram/telegrambots/client/TelegramMultipartBuilder.java
getMethod
called by 104
telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetMe.java

Shape

Method 2,274
Class 799
Interface 36
Enum 5

Languages

Java100%

Modules by API surface

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java70 symbols
telegrambots-abilities/src/test/java/org/telegram/telegrambots/abilitybots/api/bot/TestAbilityBot.java52 symbols
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/bot/BaseAbilityBot.java47 symbols
telegrambots-client/src/test/java/org/telegram/telegrambots/client/TestTelegramClientIntegration.java36 symbols
telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/test/TestDeserialization.java31 symbols
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/objects/Ability.java31 symbols
telegrambots-client-jetty-adapter/src/test/java/org/telegram/telegrambots/client/TestTelegramClientIntegration.java30 symbols
telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Update.java26 symbols
telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ExternalReplyInfo.java23 symbols
telegrambots-abilities/src/test/java/org/telegram/telegrambots/abilitybots/api/bot/TestReplyFlow.java23 symbols
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/util/AbilityUtils.java19 symbols
telegrambots-abilities/src/main/java/org/telegram/telegrambots/abilitybots/api/db/MapDBContext.java19 symbols

Dependencies from manifests, versioned

ch.qos.logback:logback-classic1.5.18 · 1×
com.fasterxml.jackson.core:jackson-annotations
com.fasterxml.jackson.core:jackson-core
com.fasterxml.jackson.datatype:jackson-datatype-jsr310
com.squareup.okhttp3:mockwebserver
io.javalin.community.ssl:ssl-plugin
io.javalin:javalin
io.javalin:javalin-testtools

For agents

$ claude mcp add TelegramBots \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact