ChatSettings class

Settings for connecting to chat platforms.

This class provides a unified way to configure chat connections without depending on platform-specific configuration classes. The platform is automatically detected based on which settings are provided.

Example:

final settings = ChatSettings({
  ChatSettings.telegramToken: 'YOUR_BOT_TOKEN',
});
final api = await ChatAPI.connect(settings);

Constructors

ChatSettings(Map<String, String> settings, {Duration pollingTimeout = const Duration(seconds: 2), bool usePolling = true})
Creates chat settings.
const
ChatSettings.telegram(String token, {Duration pollingTimeout = const Duration(seconds: 2), bool usePolling = true})
Convenience constructor for Telegram.
factory

Properties

detectedPlatform String?
Detected platform based on settings.
no setter
hashCode int
The hash code for this object.
no setterinherited
pollingTimeout Duration
Timeout for polling requests.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings Map<String, String>
Platform-specific settings as key-value pairs.
final
usePolling bool
Whether to use polling for receiving messages.
final

Methods

has(String key) bool
Check if a setting is present.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) String?
Get a setting value by key.

Constants

signalPhone → const String
Signal phone number (future).
telegramToken → const String
Telegram bot token from @BotFather.
whatsappToken → const String
WhatsApp Business API token (future).