Skip to content

MessagingService

Compey edited this page Jan 19, 2023 · 2 revisions
A JavaScript wrapper for the ROBLOX OpenCloud API.


MessagingService

PublishAsync

Publishes a message to a provided topic.

CommonJS

const MessagingService = require('rblx.js')

const message = new MessagingService({
    apiKey: "API_KEY",
    universeId: "UNIVERSE_ID", 
    intents: [ "messagingservice" ]
})

await message.PublishAsync('MessageTopic', 'I am the message body!')

ES6

import { MessagingService, ClientIntents } from 'rblx.js'

const message = new MessagingService({
    apiKey: "API_KEY",
    universeId: "UNIVERSE_ID", 
    intents: ClientIntents.MessagingService
})

await message.PublishAsync('MessageTopic', 'I am the message body!')
Returns: Promise<string|number|boolean|undefined>
Clone this wiki locally