DiscordMsg

A function that sends discord message via WebHook

Function parameters:

ParameterTypeDescriptionRequired

webHook

string

URL of a Discord WebHook bot

no

botName

string

name of the bot

no

title

string

title of the notice

no

message

string

message of the notice

yes

type

string

if type nil then type is rich

no

color

number

color of the message

no

icon

string

URL of an image

no

author

string

author of the message

no

  • Example:

HRLib = exports.HRLib:getLibFunctions() -- Getting HRLib server functions list

HRLib.RegCommand('testSendInDiscord', true, true, function(args, rawCommand, IPlayer)
    for _,v in pairs(args) do
        HRLib.DiscordMsg(nil, 'Mike', 'Test Message', v, 'rich', 555555, 'https://shorturl.at/aDEL3', IPlayer.name)
    end
end, false, {help = 'Test discord message', args = { {name = 'content', help = 'Content of the message'} } })

There's a default webHook link in the config.lua file that is using when you don't fill the webHook argument.

Last updated