webhook_send_message: Send a message via a webhook

View source: R/webhook.R

webhook_send_messageR Documentation

Send a message via a webhook

Description

Send a message via a webhook

Usage

webhook_send_message(
  webhook_url = NULL,
  message = NULL,
  username = NULL,
  embeds = NULL,
  avatar_url = NULL,
  ...
)

Arguments

webhook_url

A valid webhook URL as copied from a server's webhook settings screen.

message

Character string of message to send, limited to 2000 characters.

username

Discord username to display with the message.

embeds

Embedded objects created via embeds().

avatar_url

A valid URL to an avatar to be displayed with the username.

...

Other arguments passed to JSON/Form Params.

Value

Nothing

Source

https://discord.com/developers/docs/resources/webhook#execute-webhook

Examples

## Not run: 
webhook_url <- "https://discordapp.com/api/webhooks/<id>/<token>"

webhook_send_message(
  webhook_url = webhook_url,
  message = "Hello world!"
)

# Embedding an image
webhook_send_message(
  webhook_url = webhook_url,
  username = "Gargamel",
  message = "Hello there",
  embeds = embeds(
    description = "Just another mtcars",
    embed_image(url = image_url, title = "WHEEEEE")
  )
)

## End(Not run)

jemus42/discordiar documentation built on Feb. 2, 2024, 1:11 p.m.