Skip to content

Commit

Permalink
QB-Phone | Renewed | Imgur API integration
Browse files Browse the repository at this point in the history
As we all know discord cdn started blocking fivem's request for webhooks, so here is another solution.

FOR THIS TO WORK YOU WILL NEED MY FORK OF SCREENSHOT-BASIC:
citizenfx/screenshot-basic#41
Do the necessary changes for screenshot-basic and you are all set.
  • Loading branch information
ogidevs committed Feb 9, 2023
1 parent da4e1d6 commit 23018bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,12 @@ RegisterNUICallback("TakePhoto", function(_, cb)
QBCore.Functions.TriggerCallback("qb-phone:server:GetWebhook",function(hook)
QBCore.Functions.Notify('Touching up photo...', 'primary')
exports['screenshot-basic']:requestScreenshotUpload(tostring(hook), "files[]", function(uploadData)
local image = json.decode(uploadData)
DestroyMobilePhone()
CellCamActivate(false, false)
TriggerServerEvent('qb-phone:server:addImageToGallery', image.attachments[1].proxy_url)
TriggerServerEvent('qb-phone:server:addImageToGallery', uploadData.data.link)
Wait(400)
TriggerServerEvent('qb-phone:server:getImageFromGallery')
cb(json.encode(image.attachments[1].proxy_url))
cb(json.encode(uploadData.data.link))
QBCore.Functions.Notify('Photo saved!', "success")
OpenPhone()
end)
Expand Down
2 changes: 1 addition & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Config.BillingCommissions = { -- This is a percentage (0.10) == 10%
}

-- Web hook for camera ( NOT GO PRO )
Config.Webhook = ''
Config.Webhook = 'imgur'

-- Item name for pings app ( Having a VPN sends an anonymous ping, else sends the players name)
Config.VPNItem = 'vpn'
Expand Down

0 comments on commit 23018bd

Please sign in to comment.