Skip to main content

tpy

A strongly typed Pylon API client. https://pylon.bot/

CI CD

import Tpy from 'https://deno.land/x/tpy@0.0.1/mod.ts';
// Or use Node
// import Tpy from 'tpy';

const client = new Tpy('My.pYl0N_tOKEn');
const [err, user] = await client.getUser();

// Tpy has strongly typed error handling so there are no need for type guards.
// If there's an error, the response will return undefined,
// Otherwise, the response will the requested type as expected.
if (err) {
  throw `There was an error while fetching the user: ${TpyErrToString(err)}.`;
  // user is now !undefined.
} else console.log(`User logged in: ${user.displayName}`);

// README integrity: passing

Contributing

Currently, the library is in early development with a list of TODOs. If youโ€™d like to contribute please read the contributing guide.