# NOT RUN {
chat <- get_chat("chat-id")
# a multi-line message with an attachment
msg_text <- c(
"message line 1",
"message line 2",
"message line 3"
)
chat$send_message(msg_text, attachments="myfile.csv")
# sending an inline image
chat$send_message("", content_type="html", inline="graph.png")
# chat members
chat$list_members()
jane <- chat$get_member("Jane Smith")
bill <- chat$get_member(email="billg@mycompany.com")
# mentioning a team member
chat$send_message("Here is a message", content_type="html", mentions=jane)
# mentioning 2 or more members: use a list
chat$send_message("Here is another message", content_type="html",
mentions=list(jane, bill))
# }
Run the code above in your browser using DataLab