Skip to main content

Exports

Introduction​

A guide on the pre packaged exports

Setup​

This variable must be near the top of your script to use ccDiscordWrapper exports.

local ccDiscordWrapper = exports['ccDiscordWrapper']

Client Exports​

These exports can only be ran on the client side

There are currently no client side exports - this documentation will update when there is​

Server Exports​

These exports can only be ran on the server side

botSendNewMessage​

Explination​

Sends a Discord message using the configured Discord Bot Token to the specified channel

Usage​

if ccDiscordWrapper:botSendNewMessage(channelId, message) then
-- Code to run if the message is successfully sent
else
-- Code to run if the message fails to send
end

webhookSendNewMessage​

Explination​

Sends a Discord message using the configured Webhook URL to the specified channel

Usage​

if ccDiscordWrapper:webhookSendNewMessage(color, name, message, footer) then
-- Code to run if the message is successfully sent
else
-- Code to run if the message fails to send
end

getPlayerDiscordAvatar​

Explination​

Retrieve an in-game players Discord Avatar URL

Usage​

local avatarURL = ccDiscordWrapper:getPlayerDiscordAvatar(source)

getPlayerDiscordHighestRole​

Explination​

Retrieve an in-game players highest prioritised Discord role from the configured server

Usage​

local playerRole = ccDiscordWrapper:getPlayerDiscordHighestRole(source)

More Coming Soon!!!​