noblox-bonk
Version:
use noblox on vercel for bonk
1,628 lines (1,364 loc) • 88.6 kB
TypeScript
// Type definitions for noblox.js@4.8.0-0
// Authored by Gamenew09 w/ changes by suufi
declare module "noblox.js" {
// Interfaces/Types
import * as events from "events";
import * as stream from "stream";
/**
* request
*/
interface CookieJar
{
session?: string;
}
/**
* NobloxOptions for setOptions, based from settings.json
*/
interface NobloxOptions {
/** Minimizes data usage and speed up requests by only saving session cookies, disable if you need other cookies to be saved as well. (Default: true) */
session_only: boolean;
/** This is usually used for functions that have to receive a lot of pages at once. Only this amount will be queued up as to preserve memory, make this as high as possible for fastest responses (although it will be somewhat limited by maxSockets). (Default: 50) */
max_threads: number;
/** Timeout for http requests. This is necessary for functions that make a very large number of requests, where it is possible some simply won't connect. (Default: 10000) */
timeout: number;
event: {
/** Maximum number of consecutive retries after an event times out or fails in some other way. (Default: 5) */
maxRetries: number;
/** Maximum time (in milliseconds) a request can take. If your server has extremely high latency you may have to raise this. (Default: 10000) */
timeout: number;
/** The poll time in milliseconds by default. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
defaultDelay: number;
/** The poll time in milliseconds to check for new audit log entries. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
onAuditLog: number;
/** The poll time in milliseconds to check for new wall posts. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
onWallPost: number;
/** The poll time in milliseconds to check for new join requests. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
onJoinRequestHandle: number;
/** The poll time in milliseconds to check for new join requests. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
onJoinRequest: number;
/** The poll time in milliseconds to check for a new shout message. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
onShout: number;
/** The poll time in milliseconds to check for a new blurb message. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */
onBlurbChange: number;
/** The poll time in milliseconds to check for new transaction log entries. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. This endpoint has a low rate limit. (Default: 30000) */
onGroupTransaction: number;
}
thumbnail: {
/** Maximum number of retries to retrieve a pending thumbnail, rare, but occurs with uncached users (Roblox's cache) (Default: 2) */
maxRetries: number;
/** The time to wait between consecutive retries of retrieving pending thumbnails. (Default: 500) */
retryDelay: number;
failedUrl: {
/** The image URL to provide when an asset thumbnail is still pending; defaults to Roblox moderation icon via noblox.js's GitHub repo at https://noblox.js.org/moderatedThumbnails/moderatedThumbnail_{size}.png */
pending: string;
/** The image URL to provide when an asset thumbnail has been moderated by Roblox; defaults to Roblox moderation icon via noblox.js's GitHub repo at https://noblox.js.org/moderatedThumbnails/moderatedThumbnail_{size}.png */
blocked: string;
}
}
queue: {
Message: {
/** Although messages do have a floodcheck, it is not instituted immediately so this is disabled by default. If you are sending a lot of messages set a delay around 10-15 seconds (10000-15000). (Default: 0) */
delay: number
}
}
cache: {
/** XCSRF tokens expire 30 minutes after being created. Until they expire, however, no new tokens can be made. Sometimes an XCSRF token has already been created for the user so the server doesn't know when to collect a new one. During transitions some requests may use invalid tokens. For now, new XCSRF tokens are automatically retrieved when cached ones get rejected. */
XCSRF: {
/** Default: 1800 */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
},
/** Verification tokens seem to last extremely long times. */
Verify: {
/** Default: 7200 */
expire: number | boolean;
/** Default: 3600 */
refresh: number | boolean;
},
/** This should be fine unless your group changes its ranks often. */
Roles: {
/** Default: 600 */
expire: number | boolean;
/** Default: true */
refresh: number | boolean;
},
/** Disable this completely if you don't plan on ever changing your exile bot's rank. */
RolesetId: {
/** Default: 86400 */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
},
/** Disabled by default for security (price checks). If you are only working with ROBLOX assets, however, you can set this to something high (since ROBLOX product info rarely changes). */
Product: {
/** Default: false */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
},
/** Caches a user's username based on their ID. It is not on by default because it is an uncontrollable change but the option is there to cache it if you would like. */
NameFromID: {
/** Default: false */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
},
/** Permanent cache for a user's ID based on their name. There is no reason this would ever change (changing names would re-match it and old names cannot be reused by other accounts). Only disable if you want this to match current names only. */
IDFromName: {
/** Default: true */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
},
/** Permanent cache for the sender's user ID. This should literally never change. */
SenderId: {
/** Default: true */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
},
/** Caches rank by user ID. Changes cannot be anticipated so this is not enabled by default. */
Rank: {
/** Default: false */
expire: number | boolean;
/** Default: false */
refresh: number | boolean;
}
}
}
/// Asset
/**
* shirts = 11
* pants = 12
* decals = 13
*/
type UploadItemAssetType = 11 | 12 | 13;
interface ProductInfoCreator {
Id: number;
Name: string;
}
interface IGroupPartial {
Name: string,
Id: number,
EmblemUrl: string,
MemberCount: number,
Rank: number,
Role: string,
RoleId: number,
IsPrimary: boolean,
}
interface GroupGameInfo {
id: number;
name: string;
description?: string;
creator: { id: number; type: string; };
rootPlace: { id: number; type: string; };
created: Date;
updated: Date;
placeVisits: number;
}
interface GroupAssetInfo {
assetId: number;
name: string;
}
interface ProductInfo {
AssetId: number;
ProductId: number;
Name: string
Description: string;
AssetTypeId: number;
Creator: ProductInfoCreator;
IconImageAssetId: number;
Created: Date;
Updated: Date;
PriceInRobux?: number;
PriceInTickets?: number;
Sales: number;
IsNew: boolean;
IsForSale: boolean;
IsPublicDomain: boolean;
IsLimited: boolean;
IsLimitedUnique: boolean;
Remaining?: number;
MinimumMembershipLevel: number;
ContentRatingTypeId: number;
}
interface BuyProductInfo {
ProductId: number;
Creator: { Id: number };
PriceInRobux: number;
UserAssetId: number;
}
interface PriceRange {
high: number;
low: number;
}
interface BuyAssetResponse {
productId: number;
price: number;
}
interface ChartDataPointResponse {
value?: number;
date?: Date;
}
interface ResaleDataResponse {
assetStock?: number;
sales?: number;
numberRemaining?: number;
recentAveragePrice?: number;
originalPrice?: number;
priceDataPoints?: ChartDataPointResponse[];
volumeDataPoints?: ChartDataPointResponse[];
}
interface ResellerAgent {
id: number;
type: "User" | "Group";
name: string;
}
interface ResellerData {
userAssetId: number;
seller: ResellerAgent;
price: number;
serialNumber?: number;
}
interface ThumbnailRequest {
requestId?: string;
targetId?: number;
token?: string;
alias?: string;
type: 'Avatar' | 'AvatarHeadShot' | 'GameIcon' | 'BadgeIcon' | 'GameThumbnail' | 'GamePass' | 'Asset' | 'BundleThumbnail' | 'Outfit' | 'GroupIcon' | 'DeveloperProduct' | 'AutoGeneratedAsset' | 'AvatarBust' | 'PlaceIcon' | 'AutoGeneratedGameIcon' | 'ForceAutoGeneratedGameIcon';
size: string;
format?: 'png' | 'jpeg';
isCircular?: boolean;
}
interface ThumbnailData {
requestId?: string;
errorCode: number;
errorMessage: string;
targetId: number;
state: "Completed" | "Pending" | "Blocked";
imageUrl?: string;
}
interface UploadItemResponse {
id: number;
}
interface UploadModelResponse {
AssetId: number;
AssetVersionId : number;
}
interface UploadModelItemOptions {
name: string;
description?: string;
copyLocked?: boolean;
allowComments?: boolean;
groupId?: number;
}
interface ConfigureItemResponse {
name: string;
assetId: number;
description?: string;
price?: number;
isCopyingAllowed?: boolean;
}
/// Avatar
interface AssetTypeRulesModel
{
min: number;
max: number;
increment: number;
}
interface AvatarRulesScales
{
[scalename: string]: AssetTypeRulesModel;
}
interface WearableAssetType
{
maxNumber: number;
id: number;
name: string;
}
interface BodyColorModel
{
brickColorId: number;
hexColor: string;
name: string;
}
interface DefaultClothingAssetLists
{
defaultShirtAssetIds: number[];
defaultPantAssetIds: number[];
}
interface AvatarRules
{
playerAvatarTypes: string[];
scales: AvatarRulesScales;
wearableAssetTypes: WearableAssetType[];
bodyColorsPalette: BodyColorModel[];
basicBodyColorsPalette: BodyColorModel[];
minimumDeltaEBodyColorDifference: number;
proportionsAndBodyTypeEnabledForUser: boolean;
defaultClothingAssetLists: DefaultClothingAssetLists;
bundlesEnabledForUser: boolean;
emotesEnabledForUser: boolean;
}
interface AssetIdList
{
assetIds: number[];
}
interface AvatarScale
{
height: number;
width: number;
head: number;
depth: number;
proportion: number;
bodyType: number;
}
interface AvatarBodyColors
{
headColorId: number;
torsoColorId: number;
rightArmColorId: number;
leftArmColorId: number;
rightLegColorId: number;
leftLegColorId: number;
}
interface AvatarAssetType
{
id: number;
name: string;
}
interface AvatarAsset
{
id: number;
name: string;
assetType: AvatarAssetType;
}
type PlayerAvatarType = "R6" | "R15";
interface AvatarInfo
{
scales: AvatarScale;
playerAvatarType: PlayerAvatarType;
bodyColors: AvatarBodyColors;
assets: AvatarAsset[];
defaultShirtApplied: boolean;
defaultPantsApplied: boolean;
}
type RecentItemListType = "All" | "Clothing" | "BodyParts" | "AvatarAnimations" | "Accessories" | "Outfits" | "Gear";
type RecentItemType = "Asset" | "Outfit";
interface AssetRecentItem
{
id: number;
name: string;
type: RecentItemType;
assetType: AvatarAssetType;
isEditable?: boolean;
}
interface AssetRecentItemsResult
{
data: AssetRecentItem[];
total: number;
}
interface AvatarOutfitDetails
{
id: number;
name: string;
assets: AvatarAsset[];
bodyColors: AvatarBodyColors[];
scale: AvatarScale;
playerAvatarType: PlayerAvatarType;
isEditable: boolean;
}
interface AvatarOutfit
{
id: number;
name: string;
isEditable: boolean;
}
interface GetOutfitsResult
{
data: AvatarOutfit[];
total: number;
}
/// Chat
interface RejectedParticipant
{
rejectedReason: string;
type: string;
targetId: number;
name: string;
displayName: string;
}
interface ConversationAddResponse
{
conversationId: number;
rejectedParticipants: RejectedParticipant[];
resultType: string;
statusMessage: string;
}
interface ConversationRemoveResponse
{
conversationId: number;
resultType: string;
statusMessage: string;
}
interface ConversationRenameResponse
{
conversationTitle: string;
resultType: string;
title: ChatConversationTitle;
statusMessage: string;
}
interface SendChatResponse
{
content: string;
filteredForRecievers: boolean;
messageId: string;
sent: string;
messageType: string;
resultType: string;
statusMessage: string;
}
interface UpdateTypingResponse
{
statusMessage: string;
}
interface StartGroupConversationResponse
{
conversation: ChatConversation;
rejectedParticipants: RejectedParticipant[];
resultType: string;
statusMessage: string;
}
interface ChatSettings
{
/**
* Is chat enabled for the user.
*/
chatEnabled: boolean;
/**
* Was the Last ChatMessage Sent within the last x days or the account was created in the last x days? Note: user is active by default unless he does not chat for more than x days after account creation
*/
isActiveChatUser: boolean;
}
interface ChatMessage
{
id: string;
senderType: "User" | "System";
sent: string;
read: boolean;
messageType: "PlainText" | "Link" | "EventBased";
decorators: string[];
senderTargetId: number;
content: string;
link: ChatMessageLink;
eventBased: ChatMessageEventBased;
}
interface ChatMessageLink
{
type: "Game";
game: ChatMessageGameLink;
}
interface ChatMessageGameLink
{
universeId: number;
}
interface ChatMessageEventBased
{
type: "SetConversationUniverse";
setConversationUniverse: ChatMessageSetConversationUniverseEventBased;
}
interface ChatMessageSetConversationUniverseEventBased
{
actorUserId: number;
universeId: number;
}
interface ChatConversation
{
id: number;
title: string;
initiator: ChatParticipant;
hasUnreadMessages: boolean;
participants: ChatParticipant[];
conversationType: "OneToOneConversation" | "MultiUserConversation" | "CloudEditConversation";
conversationTitle: ChatConversationTitle;
lastUpdated: string;
conversationUniverse: ChatConversationUniverse;
}
interface ChatParticipant
{
type: "User" | "System";
targetId: number;
name: string;
displayName: string;
}
interface ChatConversationTitle
{
titleForViewer: string;
isDefaultTitle: boolean;
}
interface ChatConversationUniverse
{
universeId: number;
rootPlaceId: number;
}
type ChatFeatureNames = "LuaChat" | "ConversationUniverse" | "PlayTogether" | "Party" | "GameLink" | "OldPlayTogether";
interface GetRolloutSettingsResult
{
rolloutFeatures: ChatRolloutFeature[];
}
interface ChatRolloutFeature
{
featureName: ChatFeatureNames;
isRolloutEnabled: boolean;
}
interface GetUnreadConversationCountResult
{
count: number;
}
interface ChatConversationWithMessages
{
conversationId: number;
chatMessages: ChatMessage[];
}
interface OnUserTypingChatEvent
{
UserId: number;
ConversationId: number;
IsTyping: boolean;
}
/// Game
interface GameInstance {
id: string;
maxPlayers: number;
playing: number;
playerTokens: string[];
fps: number;
ping: number;
}
interface GamePassResponse
{
gamePassId: number,
name?: string,
description?: string,
price?: number,
isForSale?: boolean,
iconChanged?: boolean
}
type SocialLinkResponse = {
id: number;
type: 'Facebook' | 'Twitter' | 'YouTube' | 'Twitch' | 'GooglePlus' | 'Discord' | 'RobloxGroup' | 'Amazon';
url: string;
title: string;
}
interface DeveloperProduct {
ProductId: number,
DeveloperProductId: number,
Name: string,
Description: string,
IconImageAssetId: number,
displayName: string,
displayDescription: string,
displayIcon: number,
PriceInRobux: number
}
interface DeveloperProductsResult {
DeveloperProducts: DeveloperProduct[],
FinalPage: boolean,
PageSize: number
}
interface DeveloperProductAddResult
{
universeId: number,
name: string,
priceInRobux: number,
description?: string,
productId: string
}
interface DeveloperProductUpdateResult
{
universeId: number,
name: string,
priceInRobux: number,
description?: string,
productId: number
}
interface CheckDeveloperProductNameResult
{
Success: boolean;
/**
* When success is true: "Name available"
* When success is false, you can get: "Product name already exists"
*/
Message: string;
}
interface GamePassData
{
id: number;
name: string;
displayName: string;
productId?: number;
price?: number;
}
type AvatarType = "MorphToR6" | "MorphToR15" | "PlayerChoice"
type AnimationType = "Standard" | "PlayerChoice"
type CollisionType = "InnerBox" | "OuterBox"
type JointType = "Standard" | "ArtistIntent"
type Genre = "All" | "Tutorial" | "Scary" | "TownAndCity" | "War" | "Funny" | "Fantasy" | "Adventure" | "SciFi" | "Pirate" | "FPS" | "RPG" | "Sports" | "Ninja" | "WildWest"
type PlayableDevices = "Computer" | "Phone" | "Tablet" | "Console"
type Regions = "Unknown" | "China"
interface UniverseAsset
{
assetID: number,
assetTypeID: number,
isPlayerChoice: boolean
}
interface UniversePermissions
{
IsThirdPartyTeleportAllowed?: boolean;
IsThirdPartyAssetAllowed?: boolean;
IsThirdPartyPurchaseAllowed?: boolean;
}
interface UniverseSettings
{
allowPrivateServers?: boolean;
privateServerPrice?: number;
name?: string;
description?: string;
universeAvatarType?: AvatarType;
universeAnimationType?: AnimationType;
universeCollisionType?: CollisionType;
universeJointPositioningType?: JointType;
isArchived?: boolean;
isFriendsOnly?: boolean;
genre?: Genre;
playableDevices?: Array<PlayableDevices>;
universeAvatarAssetOverrides?: Array<UniverseAsset>;
isForSale?: boolean;
price?: number;
universeAvatarMinScales?: AvatarScale
universeAvatarMaxScales?: AvatarScale
studioAccessToApisAllowed?: boolean;
permissions?: UniversePermissions;
optInRegions?: Array<Regions>;
}
interface UpdateUniverseResponse extends UniverseSettings
{
id: number;
}
interface UniverseCreator {
id: number;
name: string;
type: string;
isRNVAccount: boolean;
}
interface UniverseInformation {
id: number;
rootPlaceId: number;
name: string;
description: string;
creator: UniverseCreator;
price: number;
allowedGearGenres: string[];
allowedGearCategories: string[];
isGenreEnforced: boolean;
copyingAllowed: boolean;
playing: number;
visits: number;
maxPlayers: number;
created: Date;
updated: Date;
studioAccessToApisAllowed: boolean;
createVipServersAllowed: boolean;
universeAvatarType: AvatarType;
genre: Genre;
isAllGenre: boolean;
isFavoritedByUser: boolean;
favoritedCount: number;
}
/// Group
type GroupIconSize = "150x150" | "420x420"
type GroupIconFormat = "Png"
interface Role
{
name: string;
memberCount?: number;
rank: number;
id: number;
}
interface RoleWithDescription
{
name: string;
memberCount?: number;
rank: number;
id: number;
description: string;
}
interface GroupPostsPermissions
{
viewWall: boolean;
postToWall: boolean;
deleteFromWall: boolean;
viewStatus: boolean;
postToStatus: boolean;
}
interface GroupMembershipPermissions
{
changeRank: boolean;
inviteMembers: boolean;
removeMembers: boolean;
}
interface GroupManagementPermissions
{
manageRelationships: boolean;
manageClan: boolean;
viewAuditLogs: boolean;
}
interface GroupEconomyPermissions
{
spendGroupFunds: boolean;
advertiseGroup: boolean;
createItems: boolean;
manageItems: boolean;
addGroupPlaces: boolean;
manageGroupGames: boolean;
viewGroupPayouts: boolean;
}
interface RolePermissionsBody
{
groupPostsPermissions: GroupPostsPermissions;
groupMembershipPermissions: GroupMembershipPermissions;
groupManagementPermissions: GroupManagementPermissions;
groupEconomyPermissions: GroupEconomyPermissions;
}
interface RolePermissions
{
groupId: number;
role: RoleWithDescription;
permissions: RolePermissionsBody
}
interface ChangeRankResult
{
newRole: Role;
oldRole: Role;
}
interface Group
{
id: number;
name: string;
description: string;
owner: GroupUser;
shout: GroupShout;
memberCount: number;
isBuildersClubOnly: boolean;
publicEntryAllowed: boolean;
isLocked: boolean;
}
interface GroupSearchItem
{
id: number;
name: string;
description: string;
memberCount: number;
publicEntryAllowed: boolean;
created: Date;
updated: Date;
}
interface GroupView
{
__VIEWSTATE: string;
__VIEWSTATEGENERATOR: string;
__EVENTVALIDATION: string;
__RequestVerificationToken: string;
}
interface GroupUser
{
userId: number;
username: string;
displayName: string;
buildersClubMembershipType: "None" | "BC" | "TBC" | "OBC" | "RobloxPremium";
}
interface GroupShout
{
body: string;
poster: GroupUser;
created: string;
updated: string;
}
interface GroupDescriptionResult
{
newDescription: string
}
interface GroupNameResult
{
newName: string
}
interface AuditItemActor
{
user: GroupUser;
role: Role;
}
interface AuditItem
{
actor: AuditItemActor;
actionType: string;
description: object;
created: string;
}
interface AuditPage
{
data: AuditItem[];
nextPageCursor?: string;
previousPageCursor?: string;
}
interface TransactionAgent
{
id: number;
type: string;
name: string;
}
interface TransactionDetails
{
id: number;
name: string;
type: string;
}
interface TransactionCurrency
{
amount: number;
type: string;
}
interface TransactionItem
{
id: number;
transactionType?: string;
created: Date;
isPending: boolean;
agent: TransactionAgent;
details?: TransactionDetails;
currency: TransactionCurrency;
}
interface GroupJoinRequester
{
userId: number;
username: string;
displayName: string;
}
interface GroupJoinRequest
{
requester: GroupJoinRequester;
created: Date;
}
interface GroupJoinRequestsPage
{
previousPageCursor?: string;
nextPageCursor?: string;
data: GroupJoinRequest[];
}
interface RevenueSummaryResponse
{
recurringRobuxStipend?: number;
itemSaleRobux?: number;
purchasedRobux?: number;
tradeSystemRobux?: number;
pendingRobux?: number;
groupPayoutRobux?: number;
individualToGroupRobux?: number;
}
interface WallPost
{
id: number;
poster: GroupUser;
body: string;
created: string;
updated: string;
}
interface WallPostPage
{
previousPageCursor?: string;
nextPageCursor?: string;
data: WallPost[];
}
/// Party
interface PartyData
{
PartyId: number;
PartyType: string;
}
/// User
/**
* 0 = Inbox
* 1 = Sent Messages
* 3 = Archived Messages
*/
type PrivateMessageTab = 0 | 1 | 3;
/**
* 0 = Offline
* 1 = Online
* 2 = InGame
* 3 = Studio
*/
type UserPresenceType = 0 | 1 | 2 | 3;
// https://noblox.js.org/thumbnailSizes.png | Archived: https://i.imgur.com/UwiKqjs.png
type BodySizes = 30 | 48 | 60 | 75 | 100 | 110 | 140 | 150 | 180 | 250 | 352 | 420 | 720 | "30x30" | "48x48" | "60x60" | "75x75" | "100x100" | "110x110" | "140x140" | "150x150" | "150x200" | "180x180" | "250x250" | "352x352" | "420x420" | "720x720";
type BustSizes = 50 | 60 | 75 | "50x50" | "60x60" | "75x75"
type HeadshotSizes = 48 | 50 | 60 | 75 | 100 | 110 | 150 | 180 | 352 | 420 | 720 | "48x48" | "50x50" | "60x60" | "75x75" | "100x100" | "110x110" | "150x150" | "180x180" | "352x352" | "420x420" | "720x720";
interface LoggedInUserData {
UserID: number,
UserName: string,
RobuxBalance: number,
TicketsBalance: number,
ThumbnailUrl: string,
IsAnyBuildersClubMember: boolean,
IsPremium: boolean
}
interface UserLoginApiData {
userId: number;
}
interface AvatarEntry {
url: string;
final: boolean;
}
interface UserStatus {
online: boolean;
lastSeen: Date;
}
interface FriendRequestEntry {
description: string;
created: string;
isBanned: boolean;
id: number;
name: string;
displayName: string;
}
interface FriendRequestsPage {
previousPageCursor?: string;
nextPageCursor?: string;
data: FriendRequestEntry[];
}
interface FriendEntry {
isOnline?: boolean;
presenceType: UserPresenceType;
isDeleted: boolean;
id: number;
name: string;
description: string;
created: string;
displayName: string;
}
interface Friends {
data: FriendEntry[];
}
interface FollowEntry {
isDeleted: false;
id: number;
name: string;
description: string;
created: string;
displayName: string;
}
interface FollowingsPage {
previousPageCursor?: string;
nextPageCursor?: string;
data: FollowEntry[];
}
interface FollowersPage {
previousPageCursor?: string;
nextPageCursor?: string;
data: FollowEntry[];
}
//
interface PrivateMessagesPage {
collection: PrivateMessage[];
totalPages: number;
totalCollectionSize: number;
pageNumber: number;
}
//
interface UserEntry {
userId: number;
name: string;
displayName: string;
}
interface PrivateMessageParent {
page: number;
}
interface PrivateMessage {
id: number;
sender: UserEntry;
recipient: UserEntry;
subject: string;
body: string;
created: Date;
updated: Date;
isRead: boolean;
isSystemMessage: boolean;
isReportAbuseDisplayed: boolean;
parent: PrivateMessageParent;
}
interface NotificationMessage {
type: string;
[key: string]: any;
}
type FriendRequest = number;
interface UserPresence {
userPresenceType?: UserPresenceType;
lastLocation?: string;
placeId?: number;
rootPlaceId?: number;
gameId?: string;
universeId?: number;
userId?: number;
lastOnline?: string;
}
interface PlayerInfo {
username: string;
displayName: string;
blurb: string;
joinDate: Date;
age?: number;
friendCount?: number;
followerCount?: number;
followingCount?: number;
oldNames?: string[];
isBanned: boolean;
}
interface Presences {
userPresences: UserPresence[]
}
interface PlayerThumbnailData {
targetId: number;
state: "Completed" | "Pending" | "Blocked";
imageUrl?: string;
}
interface PromotionChannelsResponse {
facebook?: string;
twitter?: string;
youtube?: string;
twitch?: string;
}
/// Badges
interface BadgeAwarder {
id: number;
type: string;
}
interface UserBadgeStats {
badgeId: number;
awardedDate: Date;
}
interface BadgeStatistics {
pastDayAwardedCount: number;
awardedCount: number;
winRatePercentage: number;
}
interface BadgeUniverse {
id: number;
name: string;
rootPlaceId: number;
}
//
interface PlayerBadges {
id: number;
name: string;
description?: string;
displayName: string;
displayDescription?: string;
enabled: boolean;
iconImageId: number;
displayIconImageId: number;
awarder: BadgeAwarder;
statistics: BadgeStatistics;
created: Date;
updated: Date;
}
//
interface BadgeInfo {
id: number;
name: string;
description?: string;
displayName: string;
displayDescription?: string;
enabled: boolean;
iconImageId: number;
displayIconImageId: number;
created: Date;
updated: Date;
statistics: BadgeStatistics
awardingUniverse: BadgeUniverse
}
//Inventory
interface AssetOwner
{
userId: number;
username: string;
buildersClubMembershipType: number;
}
interface CollectibleEntry {
userAssetId: number;
serialNumber?: number;
assetId: number;
name: string;
recentAveragePrice: number;
originalPrice?: number;
assetStock?: number;
buildersClubMembershipType: number;
}
//
interface InventoryEntry {
assetId: number;
name: string;
assetType: string;
created: Date;
updated?: Date;
assetName?: string;
userAssetId?: number;
owner?: AssetOwner;
}
///Trading
interface UAIDResponse {
uaids: number[],
failedIds: number[]
}
interface CanTradeResponse {
canTrade: boolean,
status: string
}
interface TradeUser {
userId: number;
username: string;
displayName: string;
}
interface TradeAsset {
id: number,
user: TradeUser,
created: Date,
expiration?: Date,
isActive: boolean,
status: string
}
interface DetailedTradeAsset {
id: number,
serialNumber: number,
assetId: number,
name: string,
recentAveragePrice: number,
originalPrice: number,
assetStock: number,
membershipType: string
}
interface DetailedTradeOffer {
user: TradeUser,
userAssets: DetailedTradeAsset[],
robux: number
}
interface TradeOffer {
userAssetIds: number[],
robux: number
}
interface TradeInfo {
offers: DetailedTradeOffer[],
id: number,
user: TradeUser,
created: Date,
expiration?: Date,
isActive: boolean,
status: string
}
interface SendTradeResponse {
id: number
}
/// Utility
type SelectorFunction = (selector: string) => {val(): any};
type SortOrder = 'Asc' | 'Desc';
type Limit = 10 | 25 | 50 | 100;
interface Inputs
{
/**
* With a provided name, this returns the input's value.
*/
[name: string]: string;
}
interface GetVerificationResponse
{
body?: string;
inputs: Inputs;
header: string;
}
interface HttpOptions
{
verification?: string;
jar?: CookieJar;
}
interface ThreadedPromise extends Promise<void>
{
getStatus(): number;
getCompleted(): number;
getExpected(): number;
}
interface GetLatestResponse
{
latest: number;
data: object;
repeat?: boolean;
}
// Functions
/// Asset
/**
* 🔐 Buys asset `asset` with `price` restrictions. This can be a single value or an object with `high` and `low` that sets the respective price limits (both inclusive). This allows you to buy assets with a minimum or maximum amount of robux that can be used or a single required value and therefore guarantees you can't be scammed by a sudden price change. If a price restriction is not set, the asset will be bought for however much it costs (works with free assets). You are able to use product instead of asset, the options in `product` are collected automatically if not provided.
*/
function buy(asset: number | ProductInfo | BuyProductInfo, price?: number | PriceRange, jar?: CookieJar): Promise<BuyAssetResponse>;
/**
* 🔐 Configures an item (shirt, pants, decal, etc.) with the id `id` to have `name` and `description`. If `enableComments` is true comments will be allowed and if `sellForRobux` is set it will be put on sale for that amount of robux.
*
* NOTE: Use `configureGamePass()` for Game Passes.
*/
function configureItem(id: number, name: string, description: string, enableComments?: boolean, sellForRobux?: boolean, genreSelection?: number, jar?: CookieJar): Promise<ConfigureItemResponse>;
/**
* 🔐 Deletes an item from the logged in user's inventory
*/
function deleteFromInventory(assetId: number, jar?: CookieJar): Promise<void>;
/**
* ✅ Get the recent sale history (price and volume per day for 180 days) of a limited asset.
*/
function getResaleData(assetId: number): Promise<ResaleDataResponse>;
/**
* 🔐 Gets available resale copies of a limited asset.
*/
function getResellers(assetId: number, limit?: Limit, jar?: CookieJar): Promise<ResellerData[]>;
/**
* ✅ Gets the thumbnail of asset/users.
*/
function getThumbnails(thumbnailRequests: ThumbnailRequest[]): Promise<ThumbnailData[]>;
/**
* 🔐 Uploads an image stored in `file` as an `assetType` with `name`. If `groupId` is specified it will be uploaded to that group. This is for uploading shirts, pants, or decals which have the assetTypes `11`, `12`, and `13`, respectively. Returns the asset `id` of the new item.
*/
function uploadItem(name: string, assetType: UploadItemAssetType, file: string | stream.Stream, groupId?: number, jar?: CookieJar): Promise<UploadItemResponse>;
/**
* 🔐 Uploads `data` to `asset` with `itemOptions`. If asset is empty a new asset will be created. Both the assetId as well as the assetVersionId are returned in a object. Note that `itemOptions` is required when creating a new asset. It is only optional when updating an old asset, which ignores `itemOptions` and only updates `data`.
*/
function uploadModel(data: string | stream.Stream, itemOptions?: UploadModelItemOptions, asset?: number, jar?: CookieJar): Promise<UploadModelResponse>;
/**
* 🔐 Uploads `data` to `asset` with `itemOptions`. If asset is empty a new asset will be created. The assetId is returned as a number. Note that `itemOptions` is required when creating a new asset. It is only optional when updating an old asset, which ignores `itemOptions` and only updates `data`.
*/
function uploadAnimation(data: string | stream.Stream, itemOptions?: UploadModelItemOptions, asset?: number, jar?: CookieJar): Promise<number>;
/**
* ✅ Gets `info` of `asset` and caches according to settings.
*/
function getProductInfo(asset: number): Promise<ProductInfo>;
/// Avatar
function avatarRules(option?: "playerAvatarTypes" | "scales" | "wearableAssetTypes" | "bodyColorsPalette" | "basicBodyColorsPalette" | "minimumDeltaEBodyColorDifference" | "proportionsAndBodyTypeEnabledForUser" | "defaultClothingAssetLists" | "bundlesEnabledForUser" | "emotesEnabledForUser" | undefined, jar?: CookieJar): Promise<AvatarRules>;
function avatarRules(option: "playerAvatarTypes", jar?: CookieJar): Promise<string[]>;
function avatarRules(option: "scales", jar?: CookieJar): Promise<AvatarRulesScales>;
function avatarRules(option: "wearableAssetTypes", jar?: CookieJar): Promise<WearableAssetType[]>;
function avatarRules(option: "bodyColorsPalette", jar?: CookieJar): Promise<BodyColorModel[]>;
function avatarRules(option: "basicBodyColorsPalette", jar?: CookieJar): Promise<BodyColorModel[]>;
function avatarRules(option: "minimumDeltaEBodyColorDifference", jar?: CookieJar): Promise<number>;
function avatarRules(option: "proportionsAndBodyTypeEnabledForUser", jar?: CookieJar): Promise<boolean>;
function avatarRules(option: "defaultClothingAssetLists", jar?: CookieJar): Promise<DefaultClothingAssetLists>;
function avatarRules(option: "bundlesEnabledForUser", jar?: CookieJar): Promise<boolean>;
function avatarRules(option: "emotesEnabledForUser", jar?: CookieJar): Promise<boolean>;
function currentlyWearing(userId: number): Promise<AssetIdList>;
function getAvatar(userId: number): Promise<AvatarInfo>;
function getCurrentAvatar(option?: "scales" | "playerAvatarType" | "bodyColors" | "assets" | "defaultShirtApplied" | "defaultPantsApplied" | undefined, jar?: CookieJar): Promise<AvatarInfo>;
function getCurrentAvatar(option: "scales", jar?: CookieJar): Promise<AvatarScale>;
function getCurrentAvatar(option: "playerAvatarType", jar?: CookieJar): Promise<PlayerAvatarType>;
function getCurrentAvatar(option: "bodyColors", jar?: CookieJar): Promise<AvatarBodyColors>;
function getCurrentAvatar(option: "assets", jar?: CookieJar): Promise<AvatarAsset[]>;
function getCurrentAvatar(option: "defaultShirtApplied", jar?: CookieJar): Promise<boolean>;
function getCurrentAvatar(option: "defaultPantsApplied", jar?: CookieJar): Promise<boolean>;
function getRecentItems(listType?: RecentItemListType, jar?: CookieJar): Promise<AssetRecentItemsResult>;
function outfitDetails(outfitId: number): Promise<AvatarOutfitDetails>;
function outfits(userId: number, page?: number, itemsPerPage?: number): Promise<GetOutfitsResult>;
function redrawAvatar(jar?: CookieJar): Promise<void>;
function removeAssetId(assetId: number, jar?: CookieJar): Promise<void>;
function setAvatarBodyColors(args: AvatarBodyColors & {jar?: CookieJar}): Promise<void>;
function setAvatarScales(args: AvatarScale & {jar?: CookieJar}): Promise<void>;
function setPlayerAvatarType(avatarType: PlayerAvatarType, jar?: CookieJar): Promise<void>;
function setWearingAssets(assetIds: number[], jar?: CookieJar): Promise<void>;
function wearAssetId(assetId: number, jar?: CookieJar): Promise<void>;
/// Chat
function addUsersToConversation(conversationId: number, userIds: number[], jar?: CookieJar): Promise<ConversationAddResponse>;
function chatSettings(jar?: CookieJar): Promise<ChatSettings>;
function getChatMessages(conversationId: number, pageSize?: number, exclusiveStartMessageId?: string, jar?: CookieJar): Promise<ChatMessage[]>;
function getConversations(conversationIds: number[], jar?: CookieJar): Promise<ChatConversation[]>;
function getRolloutSettings(featureNames?: ChatFeatureNames[], jar?: CookieJar): Promise<GetRolloutSettingsResult>;
function getUnreadConversationCount(jar?: CookieJar): Promise<GetUnreadConversationCountResult>;
function getUnreadMessages(conversationIds: number[], pageSize?: number, jar?: CookieJar): Promise<ChatConversationWithMessages[]>;
function getUserConversations(pageNumber?: number, pageSize?: number, jar?: CookieJar): Promise<ChatConversation[]>;
function markChatAsRead(conversationId: number, endMessageId: string): Promise<void>;
function markChatAsSeen(conversationIds: number[], jar?: CookieJar): Promise<void>;
function multiGetLatestMessages(conversationIds: number[], pageSize?: number, jar?: CookieJar): Promise<ChatConversationWithMessages[]>;
function removeFromGroupConversation(conversationId: number, userId: number, jar?: CookieJar): Promise<ConversationRemoveResponse>;
function renameGroupConversation(conversationId: number, title: string, jar?: CookieJar): Promise<ConversationRenameResponse>;
function sendChatMessage(conversationId: number, message: string, jar?: CookieJar): Promise<SendChatResponse>;
function setChatUserTyping(conversationId: number, isTyping: boolean, jar?: CookieJar): Promise<UpdateTypingResponse>;
function start121Conversation(userId: number, jar?: CookieJar): Promise<void>;
function startCloudEditConversation(placeId: number, jar?: CookieJar): Promise<void>;
function startGroupConversation(userIds: number[], title: string, jar?: CookieJar): Promise<StartGroupConversationResponse>;
/// Game
/**
* 🔐 Returns data about the existing game instances (servers) of the specified place. You must have permission to view the game's server list to use this. (Must be logged in)
* @param placeId The place whose game instances are being fetched.
* @param serverType The type of game instances to get
* @param sortOrder The order that the game instances will be sorted by (Asc or Desc)
* @param limit The maximum number of results.
*/
function getGameInstances(placeId: number, serverType?: "Public" | "Friend" | "VIP", sortOrder?: SortOrder, limit?: number): Promise<GameInstance[]>;
/**
* ✅ Get the badges in a specific game.
*/
function getGameBadges(universeId: number, limit?: Limit, cursor?: string, sortOrder?: SortOrder): Promise<BadgeInfo>
/**
* ✅ Gets a game's game passes.
*/
function getGamePasses(universeId: number, limit?: Limit): Promise<GamePassData[]>
/**
* 🔓 Returns information about the universe(s) in question, such as description, name etc; varies based on whether or not you're logged in.
* @param universeId The universe(s) whose information are being fetched.
*/
function getUniverseInfo(universeIds: number[] | number, jar?: CookieJar): Promise<UniverseInformation>;
// You can create a developer product, but the productId returned does not match the actual developer product id needed by the endpoints.
// It's strange, but the edit link on the product page has the id that Roblox wants so you can edit dev products.
function addDeveloperProduct(universeId: number, name: string, priceInRobux: number, description?: string, jar?: CookieJar): Promise<DeveloperProductAddResult>;
/**
* 🔐 Checks to see if the provided `produceName` is able to be used on `productId`.
*
* NOTE: You actually need a valid `productId` and `universeId` otherwise, the http request returns a `404 Not Found` response.
*/
function checkDeveloperProductName(universeId: number, productName: string, jar?: CookieJar, productId?: number): Promise<CheckDeveloperProductNameResult>;
/**
* 🔐 Returns the existing developer products in a specified game.
* @param placeId The place whose developer products are being fetched.
* @param page Which page of developer products to return (pageSize is 50)
*/
function getDeveloperProducts(placeId: number, page: number, jar?: CookieJar): Promise<DeveloperProductsResult>;
function updateDeveloperProduct(universeId: number, productId: number, name: string, priceInRobux: number, description?: string, jar?: CookieJar): Promise<DeveloperProductUpdateResult>;
/**
* 🔐 Configures a game pass with the id `gamePassId` to have a `name`, `description`, `price` in Robux, and `icon` image. If `name` is an empty string, only `price` is changed. Setting `price` to false, 0, or a negative value will place the game pass off-sale.
* Returns a `GamePassResponse` with the changed attributes.
*
* NOTE: Updating `name` will affect `description`: you must repeat `description` with each `name` update, or `description` will be cleared.
*/
function configureGamePass(gamePassId: number, name: string, description?: string, price?: number | boolean, icon?: string | stream.Stream, jar?: CookieJar): Promise<GamePassResponse>;
/**
* 🔐 Get the social link data associated with a game.
*/
function getGameSocialLinks(universeId: number, jar?: CookieJar): Promise<SocialLinkResponse[]>;
/**
* 🔐 Updates a universe's public access setting
*/
function updateUniverseAccess(universeId: number, isPublic?: boolean, jar?: CookieJar): Promise<void>;
/**
* 🔐 Modifies a universe's settings
*/
function updateUniverse(universeId: number, settings: UniverseSettings, jar?: CookieJar): Promise<UpdateUniverseResponse>;
/// Group
/**
* 🔐 Moves the user with userId `target` up or down the list of ranks in `group` by `change`. For example `changeRank(group, target, 1)` would promote the user 1 rank and `changeRank(group, target, -1)` would demote them down 1. Note that this simply follows the list, ignoring ambiguous ranks. The full `newRole` as well as the user's original `oldRole` is returned.
*/
function changeRank(group: number, target: number, change: number, jar?: CookieJar): Promise<ChangeRankResult>;
/**
* 🔐 Deletes the wall post with `id` in `group`. If `page` is known it can be inserted to speed up finding the post, otherwise it will search for the post. Alternatively `post` can be passed in, which only has to contain `view` and `parent.index` to work properly. Using `post` will be much faster because it will not have to search for the post first.
*/
function deleteWallPost(group: number, post: number | WallPos