TelegramNotifier constructor
TelegramNotifier({
- required String botToken,
- required String defaultChatId,
- Dio? dio,
- MessageFormatter? formatter,
Creates a service for sending notifications to Telegram.
botToken: Your Telegram Bot API token.defaultChatId: The chat ID or channel/username where messages will be sent by default.dio: (Optional) Your custom Dio client. If not provided, a default one will be created.formatter: (Optional) Your custom message formatting strategy. If not provided,DefaultJsonFormatterwill be used.
Implementation
TelegramNotifier({
required String botToken,
required String defaultChatId,
Dio? dio,
MessageFormatter? formatter,
}) : _botToken = botToken,
_defaultChatId = defaultChatId,
_dio = dio ?? Dio(),
_formatter = formatter ?? const DefaultJsonFormatter();