0.0.8 • Published 1 year ago

laby.net v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

laby.net npm npm install size

Installation

npm i -s laby.net

The unofficial JavaScript API wrapper for laby.net.

Please keep in mind: This version is not nearly finished and has many bugs, problems etc. Since the API is not intended to be a public API schemas can change at any time making this package or some functions of it useless. I will also not work that actively on this package since I mainly created it for my own private usage.

User

FunctionDescriptionReturns
badgesGet BadgesArray
friendsGet FriendsArray
roleGet RoleString
backgroundGet BackgroundString
headGet HeadString
skinGet SkinString

Server

FunctionDescriptionReturns
votesGet Server-VotesNumber
checkVoteGet Server-User-VotesString

Search

FunctionDescriptionReturns
searchSearch NameArray

User-Examples

The argument can either be a username or the users UUID (dashes required).

Array example

const laby = require('laby.net');

async function test() {
  console.log(await laby.badges('Niklas'));
}

test();

Returns:

[
  'OG Name',
  'LabyMod Staff',
  'Translator',
  'All LabyMod Cosmetics',
  'Tag Contributor'
]

String example

const laby = require('laby.net');

async function test() {
  console.log(await laby.role('Niklas'));
}

test();

Returns:

Administrator

Server-Examples

Number example

const laby = require('laby.net');

async function test() {
  console.log(await laby.votes('gommehd.net'));
}

test();

Returns:

92

Date example

const laby = require('laby.net');

async function test() {
  console.log(await laby.checkVote('gommehd.net', 'Niklas'));
}

test();

Returns:

2021-08-23T20:15:55

Search-Examples

Name example

const laby = require('laby.net');

async function test() {
  console.log(await laby.search('Niklas', 'name'));
}

test();

Returns:

[ 'Niklas', 'niklas_', 'Niklas__', 'niklas___', 'niklas____' ]

UUID example

const laby = require('laby.net');

async function test() {
  console.log(await laby.search('Niklas', 'uuid'));
}

test();

Returns:

[
  'e0276ad9-1cd6-4c8d-b8f7-ff97e75c5982',
  '1418ddff-41b5-46fa-94d6-3b30dfd89158',
  '932f1d36-dc7e-42f5-88f5-0b4238e0486f',
  '262229d3-8b08-4899-931f-a386a0431118',
  '9b4d916c-c2a8-4a6f-ab8b-698d171a6a5a'
]

Still to be fixed

Bug / ProblemUrgency
Error handeling⚠️ High
~Accepting UUIDs without dashes~✅ Added
~Custom user agent argument~✅ Added
~Adding search endpoint~✅ Added
~Adding fixed endpoint~✅ Added

Acknowledgements

LICENSE

MIT © 2022 schnappi21

0.0.8

1 year ago

0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.1

2 years ago