UNPKG

openblox

Version:

Roblox API Wrapper For Both Classic And OpenCloud APIs.

392 lines (347 loc) 18 kB
import type { Identifier } from "typeforge"; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ export declare const publishMessage: <Message extends string | Record<any, any>>(this: any, args: { universeId: Identifier; topic: string; message: Message; }) => Promise<{ data: true; response: { fullResponse: unknown; url: `https://${string}`; method: import("../../../utils/utils.types").RestMethod; success: boolean; statusCode: number; headers: Headers; body: ""; }; configUsed: { cookie?: `.ROBLOSECURITY=_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|${string}; RBXEventTrackerV2=CreateDate=1/1/1 1:1:1 PM&rbxid=1&browserid=1;` | undefined; cloudKey?: string | undefined; http?: { adapter?: import("../../../http/httpAdapters").HttpAdapter | undefined; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ csrfMaxAttempts?: number | undefined; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ csrfToken?: string | undefined; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ polling?: { disabled?: boolean | undefined; iterations?: number | undefined; multiplyer?: number | undefined; retryOffset?: number | undefined; debugMessages?: boolean | undefined; } | undefined; } | undefined; cache?: { name: string; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ get: (key: string) => any; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ set: (settings: any, key: string, value: any) => void; }[] | undefined; }; } & { again: () => Promise<{ data: true; response: { fullResponse: unknown; url: `https://${string}`; method: import("../../../utils/utils.types").RestMethod; success: boolean; statusCode: number; headers: Headers; body: ""; }; configUsed: { cookie?: `.ROBLOSECURITY=_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|${string}; RBXEventTrackerV2=CreateDate=1/1/1 1:1:1 PM&rbxid=1&browserid=1;` | undefined; cloudKey?: string | undefined; http?: { adapter?: import("../../../http/httpAdapters").HttpAdapter | undefined; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ csrfMaxAttempts?: number | undefined; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ csrfToken?: string | undefined; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ polling?: { disabled?: boolean | undefined; iterations?: number | undefined; multiplyer?: number | undefined; retryOffset?: number | undefined; debugMessages?: boolean | undefined; } | undefined; } | undefined; cache?: { name: string; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ get: (key: string) => any; /** * Publishes a message to all servers of a universe. * @endpoint POST /v1/universes/{universeId}/topics/{topic} * @tags [ "Cloud Key" ] * * @example * // Openblox (Typescript Code) - Sending Message * type Message = { targetId: number, reason: string }; await MessagingApi.publishMessage<Message>({ universeId: 5097539509, topic: "kickPlr", message: { targetId: 45348281, reason: "You smell kinda funny." } }); /* Roblox Luau Code - Recieving The Message Above local MessagingService = game:GetService("MessagingService") local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") MessagingService:SubscribeAsync("kickPlr", function(msg) local data = HttpService:JSONDecode(msg.Data) local plr = Players:GetPlayerByUserId(data.targetId) if not plr then return end plr:Kick(`You have been kicked for: "{data.reason}"`) end) *\/ * @exampleData true * @exampleRawBody "" */ set: (settings: any, key: string, value: any) => void; }[] | undefined; }; }>; }>;