Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

custom-robloxapi

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-robloxapi

A simple helper module for roblox API.

  • 1.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Description

This module supports some of ROBLOX API endpoints. You can access to basic info of user/group. We are currently updating this module every week. If you find a bug please create an issue through Github. Actually this module is open source.

Useable Function List

getUserInfoFromUsername, getUserRankInGroupFromID, getGroupInfoFromID, getUserInfoFromID

Functions

getUserInfoFromUsername Function

async function example_UserInfoFromUsername() {
    const RobloxAPI = require("custom-robloxapi") // 2. Loading Module

    let getUserInfoFromUsername = await RobloxAPI.getUserInfoFromUsername("ROBLOX") // 3. Requesting user info with ROBLOX username.

    // 4. Checking for errors below.
    if (getUserInfoFromUsername.error && getUserInfoFromUsername.message == "Invalid Username") {
        return console.log("Provided Username is invalid!")
    } else if (getUserInfoFromUsername.error) {
        return console.log("Error catched: " + getUserInfoFromUsername.message)
    }

    console.log(getUserInfoFromUsername) // 5. Logging whole info to console.
}
example_UserInfoFromUsername() // 1. Calling function first.
getUserInfoFromUsername
# Username               : Username of ROBLOX user.
# UserID                 : UserID of ROBLOX user.
# hasVerifiedBadge       : Is ROBLOX user has Verified badge?
# displayName            : Display name of ROBLOX user.

getUserRankInGroupFromID Function

async function example_UserRankInfo() {

    const RobloxAPI = require("custom-robloxapi") // 2. Loading Module

    // 3. Requesting rank info with ROBLOX UserID + ROBLOX GroupID.
    let getUserRankInGroupFromID = await RobloxAPI.getUserRankInGroupFromID({ UserID: "1", GroupID: "7" }) 

    // 4. Checking for errors below.
    if (getUserRankInGroupFromID.error && getUserRankInGroupFromID.message == "Invalid UserID") {
        return console.log("Provided UserID is invalid!")
    } else if (getUserRankInGroupFromID.error) {
        return console.log("Error catched: " + getUserRankInGroupFromID.message)
    } else if (getUserRankInGroupFromID.error && getUserRankInGroupFromID.message == "GroupID is not a number!") {
        return console.log("Provided GroupID is not a ID")
    } else if (!getUserRankInGroupFromID.Group) {
        return console.log("User is not a member of provided group!")
    }

    console.log(getUserRankInGroupFromID) // 5. Logging whole info to console.
}
example_UserRankInfo() // 1. Calling function.
getUserRankInGroupFromID
# Group.id               : ID of ROBLOX group.
# Group.Name             : Name of ROBLOX group.
# Group.memberCount      : Member count of ROBLOX group.
# Group.hasVerifiedBadge : Is ROBLOX group has Verified badge?
# Role.id                : Role id in ROBLOX group.
# Role.Name              : Role name in ROBLOX group.
# Role.Rank              : Role rank in ROBLOX group.

getGroupInfoFromID Function

async function example_GroupInfoFromID() {

    const RobloxAPI = require("custom-robloxapi") // 2. Loading Module

    // 3. Requesting rank info with ROBLOX UserID + ROBLOX GroupID.
    let getGroupInfoFromID = await RobloxAPI.getGroupInfoFromID("7")

    // 4. Checking for errors below.
    if (getGroupInfoFromID.error && getGroupInfoFromID.message == "Invalid GroupID") {
        return console.log("Provided GroupID is invalid!")
    } else if (getGroupInfoFromID.error) {
        return console.log("Error catched: " + getGroupInfoFromID.message)
    }

    console.log(getGroupInfoFromID) // 5. Logging whole info to console.
}
example_GroupInfoFromID() // 1. Calling function.
getGroupInfoFromID
# GroupID                : ID of ROBLOX group.
# Description            : Description of ROBLOX group.
# Owner.UserID           : Owner ID of ROBLOX group.
# Owner.Type             : Owner type of ROBLOX group?
# CreatedAt              : Group creation date.
# hasVerifiedBadge       : Is ROBLOX group has verified badge.

getUserInfoFromID Function

async function example_UserInfoFromID() {

    const RobloxAPI = require("custom-robloxapi") // 2. Loading Module

    let getUserInfoFromID = await RobloxAPI.getUserInfoFromID("1") // 3. Requesting more user info with ROBLOX UserId.

    // 4. Checking for errors below.
    if (getUserInfoFromID.error && getUserInfoFromID.message == "Invalid UserID") {
        return console.log("Provided UserID is invalid!")
    } else if (getUserInfoFromID.error) {
        return console.log("Error catched: " + getUserInfoFromID.message)
    }

    console.log(getUserInfoFromID) // 5. Logging whole info to console.

}
example_UserInfoFromID() // 1. Calling function.
getUserInfoFromID
# UserID                 : UserID of ROBLOX user.
# Username               : Username of ROBLOX user.
# hasVerifiedBadge       : Is ROBLOX user has Verified badge?
# displayName            : Display name of ROBLOX user.
# externalAppDisplayName : Unknown, returns null everytime.
# isBanned               : Is ROBLOX user banned?
# CreatedAt              : Creation Date of ROBLOX user.
# Description            : Description of ROBLOX user.

CHANGE NOTES

v1.3.3

# Some fixes for README.md + package.json

v1.3.2

# Second Hotfix for filtered getUserRankInGroupFromID function error.

v1.3.1

# Hotfix for filtered getUserRankInGroupFromID function error.

v1.3.0

# You can now get whole data in getUserRankInGroupFromID function.
# Code reneval, no more shitcode. All functions now seperated by modules.
# Index file changes made.

v1.2.9

# Change note version fix.

v1.2.8

# README.md not found bug fixed.

v1.2.7

# Added a line at description.

Keywords

FAQs

Package last updated on 01 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc