Skip to main content

no-camera:gallery:photo:created

Triggered when a new photo is created in the gallery.
---@class Photo
---@field id number
---@field owner_identifier string
---@field url string
---@field location string
---@field created_at number

---@param photo Photo - The newly created photo
AddEventHandler("no-camera:gallery:photo:created", function(photo)
  print(("New photo created with ID: %d by user: %s"):format(photo.id, photo.owner_identifier))
end)

no-camera:gallery:photo:deleted

Triggered when a photo is deleted from the gallery.
---@param photo_id number - The ID of the deleted photo
AddEventHandler("no-camera:gallery:photo:deleted", function(photo_id)
  print(("Photo deleted with ID: %d"):format(photo_id))
end)

no-camera:gallery:photo:shared

Triggered when a photo is shared with another player.
---@class PhotoShareDTO
---@field id number
---@field owner_identifier string
---@field url string
---@field location string
---@field created_at number
---@field new_photo_id number
---@field target_identifier string

---@param photo PhotoShareDTO - The shared photo details
AddEventHandler("no-camera:gallery:photo:shared", function(photo)
  print(("Photo %d shared with: %s by: %s"):format(photo.id, photo.target_identifier, photo.owner_identifier))
end)