Version Docs

v0.0.5Exports

Exports

Information regarding sending webhooks from another resource.

We provide exports that can be used to interact with/send webhooks through FiveM2Discord using any other resource you have on your server and the setup is pretty straight forward!


Required Params

PropTypeDefault
CHANNEL
string
none
NAME
string
SYSTEM
MESSAGE
string
none
IMAGE_URL
string
SYSTEM
EXTERNAL
boolean
none

Usage

You can call the SendWebhookLogs event using the following method.

exports['fivem2discord']:SendWebhookLogs('CHANNEL', 'NAME', 'MESSAGE', 'IMAGE_URL', EXTERNAL) 

Example

Using this method if you wanted to for example log a commands usage you can do so like this

AddEventHandler('chatMessage', function(source, name, msg)
    sm = stringsplit(msg, " ");
 
    if sm[1] == "/ooc" then
		CancelEvent()
		TriggerClientEvent('chatMessage', -1, "^6OOC | ^7" .. name, { 128, 128, 128 }, string.sub(msg,5))
        exports['fivem2discord']:SendWebhookLogs('chat', GetPlayerName(id) .. ' [ID: ' .. GetPlayerServerId(id) .. ']', data.message, 'steam', true) 
	end
end)