Class
ModerationService
NotCreatableServiceNotReplicated
Server-side service for submitting player captures to content moderation review and receiving the results asynchronously.
ModerationService lets server-side experience code submit user-generated
captures (screenshots taken with CaptureService:CaptureScreenshot()
and videos recorded with CaptureService:StartVideoCaptureAsync()) to
Roblox's content moderation pipeline and receive the review results
asynchronously.
Methods 3#
| BindReviewableContentEventProcessor | Registers a server-side processor, ordered by priority, that is invoked
for each moderation review event on reviewable content. |
| CreateReviewableContentAsync | Registers user-generated captures for moderation review and triggers the owning clients to upload them, returning the reviewable-content ID.Yields |
| CreateReviewableContentKey | Returns an opaque key that identifies a screenshot or video capture for
use with
CreateReviewableContentAsync(). |
BindReviewableContentEventProcessor(priority: int, callback: Function): RBXScriptConnection#
Binds a callback that the server invokes for each moderation review event
produced for content registered through
CreateReviewableContentAsync().
Once at least one processor is bound, review events are delivered to the
bound processors in priority order. The callback function receives a
single table with the following fields:
Id— The reviewable-content ID the event refers to.State— The review state (ReviewableContentState).Ref— The optional caller-supplied reference string passed toCreateReviewableContentAsync(), present only when one was supplied.ModerationResult— Present when a moderation result is available, a table with aCategory(ModerationResultCategory) and, when a violation is detected, aLabelsarray ofModerationResultLabelvalues.
Processors run as a chain: if a processor returns true, the event is
acknowledged, deleted from the backend, and removed from the pending set,
and no further processors run for that event. If it returns false (or
does not return a boolean), the next processor runs; if no processor
returns true, the event is left unacknowledged and redelivered on a
later poll.
| Name | Type | Default | Description |
|---|---|---|---|
priority | int | Determines the order in which this processor is invoked relative to other bound processors. | |
callback | Function | The function invoked for each reviewable-content event. It receives a
table describing the event and should return true to acknowledge the
event or false to leave it for redelivery. |
Returns
RBXScriptConnection— A connection that can be disconnected to unregister the processor.
CreateReviewableContentAsync(config: Dictionary): string#
Yields
Registers one or more captures as a single unit of reviewable content and starts its moderation review. This is a yielding function that must be called on the server and is restricted to allow-listed universes; calling it from a universe that is not permitted to use this API raises an error.
The config table accepts:
Id— An optional caller-chosen ID for the reviewable content. Supplying an ID that already exists raises an error.Ref— An optional reference string echoed back on the events delivered to processors bound withBindReviewableContentEventProcessor().Content— A list of items (currently limited to one), each containing either anImageor aVideotable with aUserId(the owning player) and aContentKeyobtained fromCreateReviewableContentKey().
The method registers the content with the backend and returns the reviewable content ID. Review results are later delivered to bound processors as the moderation review completes.
| Name | Type | Default | Description |
|---|---|---|---|
config | Dictionary | A table of parameters describing the content to review, including an
optional Id, an optional Ref, and a Content list of image or
video items. |
Returns
string— The ID of the created reviewable content.
CreateReviewableContentKey(content: Content): string#
Produces an opaque key that describes a single capture so it can be
submitted to
CreateReviewableContentAsync().
The content must reference a supported capture (a temporary content URI
produced by CaptureService:CaptureScreenshot(), a
ScreenshotCapture object, or a VideoCapture object). Any
other content raises an error.
| Name | Type | Default | Description |
|---|---|---|---|
content | Content | A Content referring to a screenshot or video capture (a
temporary URI from CaptureService:CaptureScreenshot(), a
ScreenshotCapture, or a VideoCapture). |
Returns
string— An opaque content key identifying the capture.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild