Package com.tnsai.channels.telegram
Class TelegramAdapterFactory
java.lang.Object
com.tnsai.channels.telegram.TelegramAdapterFactory
- All Implemented Interfaces:
ChannelAdapterFactory
SPI factory for creating
TelegramAdapter instances.
Reports available only when the Telegram Bot API SDK
(com.pengrad.telegrambot.TelegramBot) is on the classpath.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new adapter instance with the given configuration.Human-readable display name for UI and logging.getType()Unique type identifier for this channel (e.g.booleanWhether the required platform SDK classes are on the classpath.
-
Constructor Details
-
TelegramAdapterFactory
public TelegramAdapterFactory()
-
-
Method Details
-
getType
Description copied from interface:ChannelAdapterFactoryUnique type identifier for this channel (e.g. "telegram", "discord", "slack").- Specified by:
getTypein interfaceChannelAdapterFactory
-
getDisplayName
Description copied from interface:ChannelAdapterFactoryHuman-readable display name for UI and logging.- Specified by:
getDisplayNamein interfaceChannelAdapterFactory
-
create
Description copied from interface:ChannelAdapterFactoryCreates a new adapter instance with the given configuration.- Specified by:
createin interfaceChannelAdapterFactory- Parameters:
config- platform-specific configuration (e.g. bot token, webhook URL)- Returns:
- a configured but not yet started adapter
-
isAvailable
public boolean isAvailable()Description copied from interface:ChannelAdapterFactoryWhether the required platform SDK classes are on the classpath.This allows consumers to discover which adapters are actually usable at runtime, since platform SDKs are optional dependencies.
- Specified by:
isAvailablein interfaceChannelAdapterFactory- Returns:
trueif all required dependencies are available
-