forked from Harley2787/qb-bugreport
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
24 lines (20 loc) · 860 Bytes
/
Copy pathserver.lua
File metadata and controls
24 lines (20 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--[[
Webhook = "DISCORD LINK" <---- Example
]]--
QBCore = exports['qb-core']:GetCoreObject()
Webhook = nil -- Change to "PUT LINK HERE"
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
if Webhook ~= nil then
print("^2Webhook Found | Bug Reports Resource Started!")
else
print("^5 You Need to put a webhook in server.lua line 7!")
Citizen.Wait(250)
StopResource(resource)
end
end
end)
RegisterNetEvent('qb-bugreport:server:SendToDiscord', function(message, user_report)
message = message .." | This Bug Report Was Send From: " ..user_report
PerformHttpRequest(Webhook, function(err, text, headers) end, 'POST', json.encode({username = "Bug Report!", content = message}), { ['Content-Type'] = 'application/json' })
end)