Roblox UtilitiesDevlHub Roblox Documentation

Class

ModerationService

NotCreatableServiceNotReplicated
Inherits
Instance › Object
Memory category
Instances

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#

BindReviewableContentEventProcessorRegisters a server-side processor, ordered by priority, that is invoked for each moderation review event on reviewable content.
CreateReviewableContentAsyncRegisters user-generated captures for moderation review and triggers the owning clients to upload them, returning the reviewable-content ID.Yields
CreateReviewableContentKeyReturns 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 to CreateReviewableContentAsync(), present only when one was supplied.
  • ModerationResult — Present when a moderation result is available, a table with a Category (ModerationResultCategory) and, when a violation is detected, a Labels array of ModerationResultLabel values.

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.

NameTypeDefaultDescription
priorityintDetermines the order in which this processor is invoked relative to other bound processors.
callbackFunctionThe 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

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 with BindReviewableContentEventProcessor().
  • Content — A list of items (currently limited to one), each containing either an Image or a Video table with a UserId (the owning player) and a ContentKey obtained from CreateReviewableContentKey().

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.

NameTypeDefaultDescription
configDictionaryA 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.

NameTypeDefaultDescription
contentContentA 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
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed