Send a chat (DM) message
send_chat_message.RdSends a direct message to an existing chat room using the SendChatMessage
RPC.
Arguments
- client
A
mixi2_clientobject created bymixi2_client().- room_id
ID of the chat room to send the message to.
- text
Message text. Either
textormedia_idmust be provided.- media_id
ID of a media attachment (from
upload_media()). Eithertextormedia_idmust be provided.
Details
The application can only reply to an existing conversation; it cannot
initiate a new DM. The room_id is available in chat message events
received via Webhook.
Examples
if (FALSE) { # \dontrun{
client <- mixi2_client()
# Reply with text
send_chat_message(client, room_id = "room_123", text = "Hello!")
# Reply with media
media_id <- upload_media(client, "image.jpg")
send_chat_message(client, room_id = "room_123", media_id = media_id)
} # }