Learn R Programming

evolution (version 0.1.0)

send_text: Send a plain text message

Description

Sends a plain text WhatsApp message using Evolution API v2.

Usage

send_text(
  client,
  number,
  text,
  delay = NULL,
  link_preview = NULL,
  mentions_everyone = NULL,
  mentioned = NULL,
  quoted = NULL,
  verbose = FALSE
)

Value

A named list parsed from the JSON response returned by Evolution API, containing the message key (with remoteJid, fromMe, id), message, messageTimestamp, and status. The HTTP status code is stored in attr(result, "http_status").

Arguments

client

An evo_client() object.

number

Character. Recipient number with country code (e.g., "5581999990000" or "+5581999990000").

text

Character. Message body.

delay

Integer (ms). Optional presence delay before sending. Simulates typing before the message is sent.

link_preview

Logical. Enable URL link preview in the message.

mentions_everyone

Logical. Mention everyone in a group.

mentioned

Character vector of JIDs to mention (e.g., jid("+5581999990000")).

quoted

Optional list with Baileys message key and message to reply to a specific message.

verbose

Logical. If TRUE, logs request/response details with cli.

See Also

send_media(), send_location(), jid()

Examples

Run this code
if (FALSE) {
client <- evo_client("https://my-host", Sys.getenv("EVO_APIKEY"), "myInst")
send_text(client, "5581999990000", "Hello from R!", verbose = TRUE)
}

Run the code above in your browser using DataLab