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

unb-api

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unb-api

API wrapper for UnbelievaBoat Discord Bot API

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
125
decreased by-44.69%
Maintainers
1
Weekly downloads
 
Created
Source

UnbelievaBoat API

Discord npm npm downloads Open Source Love NPM

Installation

npm install unb-api

Documentation

Full API documentation is located at https://unbelievaboat.com/api/docs

Example

const { Client } = require('unb-api');
const client = new Client('TOKEN');    // Get your API token from https://unbelievaboat.com/api/docs

const guildID = '305129477627969547';
const userID = '261674810914897931';

client.getUserBalance(guildID, userID).then(user => console.log(user));
client.getGuildLeaderboard(guildID, { sort: 'cash' }).then(lb => console.log(lb));

Constructor

new Client(token, [options])

Options
TypePropertyDescription
StringbaseURL?API hostname. Defaults to https://unbelievaboat.com/api
Numberversion?API version. Defaults to the latest version
NumbermaxRetries?Maximum number of times to retry a request if it's ratelimited. Defaults to 3

Methods

getUserBalance(guild_id, user_id)

Returns: Promise<User>

setUserBalance(guild_id, user_id, { cash, bank }, reason)

Returns: Promise<User>

editUserBalance(guild_id, user_id, { cash, bank }, reason)

Returns: Promise<User>

getGuildLeaderboard(guild_id, [query])
JSON Query Parameters
TypePropertyDescription
Stringsort?Sort the leaderboard by cash, bank or total. Default is total.
Numberlimit?Limit the number of users returned. Default is no limit, unless a page is given then it's 1000.
Numberoffset?Specify the offset of the first user.
Numberpage?Specify the page. If a page is given, the response will be Promise<{ users: User[], totalPages: Number }>

Returns: Promise<User[]>

getGuild(guild_id)

Returns: Promise<Guild>

getApplicationPermission(guild_id)

Returns: Promise<Permission>

Structures

User
TypePropertyDescription
Numberrank?Leaderboard rank of the user. This is only present on getUserBalance() and getGuildLeaderboard()
Stringuser_idUser ID of the discord user.
NumbercashUser's cash balance.
NumberbankUser's bank balance.
NumbertotalUser's total balance.
Guild
TypePropertyDescription
StringidGuild ID.
StringnameGuild name.
NumbericonIcon hash.
NumbericonURLIcon url.
StringownerIDUser ID of the owner.
NumbermemberCountTotal number of members.
StringcurrencySymbolCurrency symbol
Permission
TypePropertyDescription
NumberallowThe allowed bitwise permissions number.
StringjsonJSON representation of the allowed and denied permissions.

Support

Discord Server

Keywords

FAQs

Package last updated on 28 Jan 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