π Discord Logs Setup
NoLag Properties can post property events to Discord with webhooks. You can send everything to one channel, or split events by category.
Requirements
- A Discord server where you can create webhooks.
Setup
- 1
- 2
- 3
- 4
Categories
Each message includes the IDs, player identifiers, labels, and prices that apply.
Examples
server.cfg
Every event goes to that channel.
server.cfg
- Buy, rent, and sell events go to the transaction channel.
- Raids go to the raid channel.
- Everything else goes to the general channel.
Troubleshooting
- No logs in Discord. Check that
Logs = "discord"is set inconfig.lua, that the convars come beforeensure nolag_properties, and that the webhook still exists in Discord. Then restart the resource. - Logs go to the wrong channel. A webhook always posts to the channel it was created in. Use the URL of the right channel.
SET_YOUR_WEBHOOK_IN_SERVER.CFGin errors. No webhook convar was found. AddpropertiesDiscordWebhooktoserver.cfg.
Change the messages
The Discord messages are built in custom/logs/discord.lua. Edit it to change titles, colors, or fields, then restart the resource.
To send logs somewhere else, copy custom/logs/ox_lib.lua to a new file, for example custom/logs/mylogs.lua. Change the check at the top to if Config.Logs ~= "mylogs" then return end, keep every function in the Logs table, and set Logs = "mylogs" in config.lua.