% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/channel_downloads.R
\name{batch_download_channels}
\alias{batch_download_channels}
\title{Batch Download Multiple Telegram Channels}
\usage{
batch_download_channels(
  channels,
  session,
  api_id,
  api_hash,
  info_file = NULL,
  msgs_file = NULL,
  reactions_file = NULL,
  replies_file = NULL,
  start_date = NULL,
  limit = Inf,
  timeout_sec = 30,
  max_timeouts = 5,
  chunk_size = 5000L,
  skip_completed = TRUE,
  dedup = TRUE,
  pkg_path = NULL,
  workers = 1L,
  verbose = TRUE
)
}
\arguments{
\item{channels}{character vector. Channel usernames (with or without "@") or
numeric ids.}

\item{session}{character. Path to the Telegram session file (passed to
\code{TelegramClient$new()}).}

\item{api_id}{integer. Telegram API id.}

\item{api_hash}{character. Telegram API hash.}

\item{info_file}{character. Required. Path to the CSV file for channel info rows (appended to).}

\item{msgs_file}{character. Required. Path to the CSV file for message rows (appended to, streamed
in \code{chunk_size} chunks to avoid RAM accumulation).}

\item{reactions_file}{character or NULL. If set, reaction counts are written
to this CSV file.}

\item{replies_file}{character or NULL. If set, reply counts are written to
this CSV file.}

\item{start_date}{character/Date/POSIXct or NULL. Passed to
\code{download_channel_messages()}.}

\item{limit}{integer or Inf. Max messages per channel.}

\item{timeout_sec}{numeric. Per-fetch timeout in seconds.}

\item{max_timeouts}{integer. Timeouts before aborting a single channel.}

\item{chunk_size}{integer. Rows buffered before each CSV flush.}

\item{skip_completed}{logical. If TRUE (default), skip channels whose
username already appears in \code{msgs_file}.}

\item{dedup}{logical. If TRUE (default), skip messages already present in
\code{msgs_file} based on \code{message_id}.}

\item{pkg_path}{character or NULL. Path to the package root; passed to
\code{devtools::load_all()} inside the subprocess. When NULL (default),
\code{library(telegramR)} is used instead.}

\item{workers}{integer. Number of parallel workers. Default 1L (sequential).}

\item{verbose}{logical. If TRUE (default), print progress messages.}
}
\value{
A tibble with columns \code{channel}, \code{status}
  ("ok"/"skipped"/"error"), \code{rows_downloaded}, \code{error_message}.
}
\description{
Downloads info and messages for multiple channels in sequence, running each
channel in an isolated \code{callr} subprocess so crashes cannot corrupt the
parent session. Supports resume: channels already present in \code{msgs_file}
are skipped when \code{skip_completed = TRUE}.
}
