initializeSlackService method

Future<SlackService?> initializeSlackService(
  1. String channel
)

Builds a SlackService from the stored bot token, or returns null (with a warning) when Slack has not been configured.

Implementation

Future<SlackService?> initializeSlackService(String channel) async {
  final slackToken = await ConfigService.getSlackBotToken();

  if (slackToken == null || slackToken.isEmpty) {
    Logger.warning(
        'Slack notifications disabled (not configured). Run "udara_cli setup --notify" to enable.');
    return null;
  }

  Logger.info('Slack notifications enabled for channel: $channel');
  return SlackService(
    botToken: slackToken,
    channel: channel,
    debugMode: Logger.verbose,
  );
}