/biscuit

the black magic library 🧙‍♂️

Primary LanguageTypeScriptApache License 2.0Apache-2.0

biscuit

A brand new bleeding edge non bloated Discord library

biscuit

Install (for node18)

npm install @biscuitland/core
yarn add @biscuitland/core

for further reading join our Discord

Most importantly, biscuit:

Stands apart from other libraries like Discord.js or Eris as it takes a conscious and dedicated approach, adhering strictly to simplicity. We have examined the features and functionalities that contribute to bloat in libraries, intentionally removing unnecessary complexities we deliver a minimalistic and efficient solution that includes only essential components for Discord API interaction, reducing the library's footprint and enabling scalability.

High RAM usage in other libraries often arises due to unnecessary features and functionalities and suboptimal caching mechanisms tied to the core library.

Leveraging the power of meta programming

The Proxy object enables dynamic, flexible and efficient calls to the API, it is typesafe due to TypeScript wizardry, meta programming is not for the weak minded.

Why biscuit?:

  • Remarkably minimal memory footprint
  • Scalable
  • Non feature-rich!

Example bot (TS/JS)

import { Session } from '@biscuitland/core';
import { GatewayIntentBits, InteractionType, InteractionResponseType } from '@biscuitland/common';

const session = new Session({
  intents: GatewayIntentBits.Guilds,
  token: 'your token goes here'
});

const commands = [
  {
    name: 'ping',
    description: 'Replies with pong!'
  }
];

session.once('READY', (payload) => {
  const username = payload.user.username;
  console.log('Logged in as: %s', username);
  session.managers.applications.bulkCommands(session.applicationId, commands);
});

session.on('INTERACTION_CREATE', (interaction) => {
  if (interaction.type !== InteractionType.ApplicationCommand) return;
  session.managers.interactions.reply(interaction.id, interaction.token, {
    type: InteractionResponseType.ChannelMessageWithSource,
    data: { content: 'pong!' }
  });
});

session.start();

Links