Discord Webhooks

srb_lib provide functions for Discord communications.

Send Discord Log

This function is to send a simple discord embed log.

--- Send a discord log
---@param url string
---@param avatarURL string
---@param username string
---@param titleAvatarURL string
---@param title string
---@param text string
---@param color hex
function SRB:SendDiscordLog(url, avatarURL, username, titleAvatarURL, title, text, color)

Send Discord Embed

Get more flexibility with this function to customize all of your embed.

--- Send a discord embed
---@param url string
---@param avatar_url string
---@param username string
---@param title string
---@param description string
---@param color hex
---@param footer table -- [text] string, [icon_url] string?, [proxy_icon_url] string?
---@param image table -- [url] string, [proxy_url] string?, [height] integer?, [width] integer?
---@param author table -- [name] string, [url] string?, [icon_url] string?, [proxy_icon_url] string?
---@param fields table -- [[name] string, [value] string, [inline] boolean]
function SRB:SendDiscordEmbed(url, avatar_url, username, title, description, color, footer, image, author, fields)

Send Discord Message

Use this function to send a simple Discord message.

--- Send a discord message
---@param url string
---@param avatar_url string
---@param username string
---@param content string
function SRB:SendDiscordMessage(url, avatar_url, username, content)

Send Discord Webhook

If you prefer you can setup all of your webhook with this function.

--- Send a discord webhook
---@param url string
---@param avatar_url string
---@param username string
---@param content string
---@param embed table -- [title] string, [description] string, [color] integer, [footer] table, [image] table, [author] table, [fields] table
function SRB:SendDiscordWebhook(url, avatar_url, username, content, embeds)

Last updated