DInteg/Example/addHookFormattingExample

= addHook Formatting Example =

The formating uses { argsPos } to formate using a value.

Example
PlayerSay Hook

The PlayerSay gives you the args ( sender, text, teamChat ) To make the webhook say "Player01 said Hello" you would do "{1} said {3}"

This is a config example addHook({   hook = "PlayerSay", -- Hook Name    name = "Chat Relay", -- Unquie Name    webhook = "aRandomWebhookUrl",    message = "{1} said {3}", -- {argPos} will be replaced with the argument at that position from the hook })

This is the same as above but with PlayerInitialSpawn Hook The PlayerInitialSpawn gives you the args ( player, transition ) To make the webhook say "Player01 has joined the server" you would do "{1} has joined the server"

addHook({   hook = "PlayerInitialSpawn",    name = "Welcome Message",    webhook = "aRandomWebhookUrl",    message = createEmbed({ title = "{1} has joined the server", }), })