A brand new bleeding edge non bloated Discord library (based on Discordeno!)

Overview

biscuit

A brand new bleeding edge non bloated Discord library

nest.land npm downloads deno.land

biscuit

Install (for node18)

npm install @oasisjs/biscuit
pnpm add @oasisjs/biscuit
yarn add @oasisjs/biscuit

The biscuit Discord library is built ontop of Discordeno and webspec APIs, we aim to provide portability. Join our Discord

Most importantly, biscuit is:

  • A modular Discordeno fork
  • A framework to build Discord bots
  • A bleeding edge API to contact Discord

Biscuit is primarily inspired by Discord.js and Discordeno but it does not include a cache layer by default, we believe that you should not make software that does things it is not supposed to do.

Why biscuit?:

  • Minimal, non feature-rich!
  • Crossplatform
  • Consistent
  • Performant
  • Small bundles

Example bot (TS/JS)

import Biscuit, { GatewayIntents } from "@oasisjs/biscuit";

const intents = GatewayIntents.MessageContent | GatewayIntents.Guilds | GatewayIntents.GuildMessages;
const session = new Biscuit({ token: "your token", intents });

session.on("ready", ({ user }) => {
    console.log("Logged in as:", user.username);
});

session.on("messageCreate", (message) => {
    if (message.content.startsWith("!ping")) {
        message.reply({ content: "pong!" });
    }
});

session.start();

Mininal style guide

  • 4 spaces, no tabs
  • Semi-colons are mandatory
  • Run deno fmt
  • Avoid circular dependencies

Contrib guide

  • Install Deno extension here
  • Run deno check to make sure the library works
  • Avoid sharing state between classes

Compatibility (bun)

⚠️ DISCLAIMER: since bun is unstable I highly recommend running biscuit on node!

  • We got the library running on EndeavourOS but it spams the ready event multiple times
  • We got the library running on Arch/Artix Linux but breaks when sending fetch requests
  • We got the library running on WSL (Ubuntu) without any trouble

if you really want to use the library with bun remember to clone the repo instead of installing it via the registry

Known issues:

  • some properties may be not implemented yet
  • some structures are not implemented (see https://github.com/oasisjs/biscuit/issues)
  • cache (wip)
  • no optimal way to create embeds, should be fixed in builders tho
  • no optimal way to deliver a webspec bun version to the registry (#50)
Comments
  • THIS LIBRARY RUINED MY LIFE

    THIS LIBRARY RUINED MY LIFE

    Which package is this bug report for?

    core

    Issue description

    THIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFE

    Code sample

    THIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFE
    

    Package version

    THIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFE

    Node.js version

    THIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFE

    Operating system

    THIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFE

    Priority this issue should have

    High (immediate attention needed)

    Which gateway intents are you subscribing to?

    GuildIntegrations

    I have tested this issue on a development release

    THIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFETHIS LIBRARY RUINED MY LIFE

    opened by FabrizioCoder 4
  • Can't find variable: `require`

    Can't find variable: `require`

    When I try to use the discord bun example and then run it this message appeared

    Screenshot 2022-07-14 102533

    Error: ReferenceError: Can't find variable: require.

    Biscuit Version: 0.1.0

    Bug bun 
    opened by abdfnx 4
  • Add github actions

    Add github actions

    Which package is the feature request for?

    core

    Feature

    It seems to me a good idea to implement actions for this repository, since it would improve the pull requests, and it would automate the deployment of new versions

    Ideal solution or implementation

    Use Github actions

    Alternative solutions or implementations

    No response

    Other context

    No response

    opened by Michael-Liendo 2
  • SyntaxError: Importing binding name 'GatewayIntents' is not found.

    SyntaxError: Importing binding name 'GatewayIntents' is not found.

    Hi again, I tried the new version of biscuit with the new version of bun v0.1.5, it's shows this error

    Screenshot 2022-07-30 210033

    code

    import { Session, GatewayIntents } from "@biscuitland/core";
    
    const intents =
      GatewayIntents.MessageContent |
      GatewayIntents.Guilds |
      GatewayIntents.GuildMessages;
    const session = new Session({ token: "your token", intents });
    
    session.events.on("ready", ({ user }) => {
      console.log("Logged in as:", user.username);
    });
    
    session.events.on("messageCreate", (message) => {
      if (message.content.startsWith("!ping")) {
        message.reply({ content: "pong!" });
      }
    });
    
    session.start();
    
    opened by abdfnx 2
  • feat(extra): collectors

    feat(extra): collectors

    Hey! You're doing a great job with the lib and I wanted to contribute so I made an 'extra' package which currently only has collectors and they can be used in any event.

    Cool example

    import { GatewayIntents } from '@biscuitland/api-types';
    import { Session, Events } from '@biscuitland/core';
    import { Collector } from '@biscuitland/extra';
    
    const session = new Session({
        token: 'token',
        intents: GatewayIntents.MessageContent | GatewayIntents.GuildMessages | GatewayIntents.GuildMembers
    });
    
    session.events.on('messageCreate', async (message) => {
        if (message.content === '!nick') {
            let nick = message.member?.nickname ?? message.author.username;
    
            const m = await message.reply({
                content: `your nickname is ${nick}`
            });
    
            const collector = new Collector(session, {
                event: 'guildMemberUpdate',
                filter: (member) => member.id === message.author.id && (member.nickname ?? member.user.username) !== nick,
                time: 20e3
            });
    
            collector.on('collect', (member) => {
                nick = member.nickname ?? member.user.username;
                m.edit({ content: `your nickname is ${nick}` }).catch(console.error);
            });
        }
    });
    
    session.start();
    
    opened by Drylozu 1
  • Top level declarations should have a descriptive type signature

    Top level declarations should have a descriptive type signature

    eg: replace: export const whatever = new Symbol() with: export const whatever: symbol = new Symbol()

    replace: export function sayHello() with: export function sayHello(): void

    help wanted Refactor 
    opened by yuzudev 1
  • basic refactoring of @biscuitland/ws

    basic refactoring of @biscuitland/ws

    Which package is the feature request for?

    ws

    Feature

    The code has been cleaned up and restructured to make it simpler.

    The gateway will not expose an adapter due to the complexity of the gateway and users are urged to implement the existing solution in addition to the handler.

    In the future, the concept of platforms and transports will be added.

    Platforms will be systems (such as adapters) to manage and route usage, while transports will be communication strategies between processes/workers.

    • @biscuitland/ws should be better documented and factored some code.
    • @biscuitland/ws will not be able to be exposed in a pre-finished form and will require the use of platforms and transporters.
    • @biscuitland/ws because of the complexity of the library has been preferred to have a more readable code than the rest of the biscuitland libraries.
    • @biscuitland/ws everything done to make
    [Connecting - STEP 1]
    
        - Client should immediately receive an Opcode 10 Hello payload [READY].
        - Client can start sending Opcode 1 Heartbeat payloads after heartbeat_interval * jitter [NOT READY].
        - The gateway may request a heartbeat from the client in some situations by sending an Opcode 1 heartbeat . When this occurs, the client should immediately send an Opcode 1 Heartbeat without waiting for the remainder of the current interval. [READY]
        - Each time the client sends a heartbeat, the gateway will respond with Opcode 11 Heartbeat ACK [READY].
        - If a client does not receive a heartbeat acknowledgement between its attempts to send heartbeats, this may be due to a failed or "zombie" connection. Then, the client should immediately terminate the connection with a closing code other than 1000 resume<Resume>. [READY]
    
    [identifying - STEP 2]
    
        - If the payload is valid, the gateway will respond with a ready<Ready> event. [READY]
        - Limited by maximum concurrency the gateway will respond with an Opcode 9 Invalid Session [READY].
    
    [resuming - STEP 3]
    
        - Disconnects occur, especially with persistent connections. [READY]
        - Due to Discord's architecture, this is a semi-regular event [READY].
        - Your client must store the session_idy resume_gateway_url of the ready<Ready> [READY].
        
        - When your client detects that it has disconnected, it should close the connection completely and open a new one [SEMI-READY]
        - (following the same strategy as Connecting / STEP 1) [READY] [READY]
    
        - resume_gateway_url Once the new connection has been opened, the client must send a Resume Gateway<Resume> [READY].
        - the client must send a Gateway resume<Resume> [READY].
    
        - If successful, the gateway will respond by replaying all the lost events in order [NOT READY]
        - ending with a resumed<Resumed> event to indicate that playback is complete and all subsequent events are new [NOT READY].
    
        - In which case the client will receive an invalid opcode 9 session and is expected to wait a random amount of time, between 1 and 5 seconds, and then send a new opcode 2 ID [NOT READY]. 
    
        - If not respected, it is resume_gateway_url possible that your client will be forced to reconnect after a short period of time. [NOT READY]
    
    [Disconnections - INT]
    
        - If the gateway ever issues a disconnect to your client, it will provide a shutdown event code that you can use to properly handle the disconnect. A complete list of these shutdown codes can be found in the Response Codes documentation. [READY]
    
        - When you close the connection to the gateway with close code 1000 or 1001, your session will be invalidated and your bot will appear offline. If you simply close the TCP connection or use a different close code, the bot session will remain active and timeout after a few minutes. This may be useful for a reconnection, which will resume the previous session. [NOT READY]
    
    [Tracking Status - INT]
    
        - Most of a client's status is provided during the ready<Ready> [READY] event.
        - Discord expects clients to locally cache as many relevant object states as possible and update them as gateway events are received. [READY]
    
    [Advanced Fragmentation - INT]
    
        - Fragmentation formula (shard_id = (guild_id >> 22) % num_shards) [READY].
    
        - Note that num_shards does not relate to or limit the total number of potential sessions: it is only used to route traffic. As such, sessions do not have to be identified in an evenly distributed manner when fragmenting [READY]
    
        - [shard_id, num_shards]or sessions with different num_shardsvalues. This allows you to create sessions that will handle more or less traffic than others for tighter [READY] load balancing
        - orchestrate "zero downtime" scaling/upgrading by transferring traffic to a new implementation of sessions with a higher or lower num_shardscount that are prepared in parallel. [READY]
    
        [Maximum concurrency]
    
            - rate_limit_key = shard_id % max_concurrency [READY].
            - This puts your shards into "buckets" of max_concurrencysize. When you start your bot, you can start with max_concurrencyfragments at a time, and you must start them by "bucket" in order. [READY]
    

    Ideal solution or implementation

    The ideal solution is basically planned and implemented.

    it is necessary to add some types, better comment the code and allow advanced customizations to @biscuitland/ws technical tests performed on the @biscuitland/ws library conclude a negligible use of resources.

    Tested on a bot with 250,000+ guilds and more than 200 shards the constant consumption has been 120mb / 250mb and the CPU usage has remained below 2% at all times.

    The @biscuitland/ws does not hold any cache currently. And it will be projected to go through @biscuitland/cache for the use of the platforms.

    • @biscuitland/ws has been tested and is functional.
    • @biscuitland/ws is tested in heavy event usage

    Alternative solutions or implementations

    No response

    Other context

    No response

    Feature Future major 
    opened by dragurimu 1
  • create and test @biscuitland/cache

    create and test @biscuitland/cache

    Due to the limits imposed by discord to safeguard its infrastructure, a modern cache system is necessary.

    The package must be built with the objective of providing a data abstraction where information can be read and written.

    • @biscuitland/cache must be abstract and highly customizable.
    • @biscuitland/cache should provide methods to know its current state
    • @biscuitland/cache like all biscuit packages, is an adapter and can be easily modified.
    • @biscuitland/cache it should be global with a style centered on <K, V> (key and value) and be easily mutable in its data (and depending on the case it should support updates, cascading deletions)
    Feature Future major 
    opened by dragurimu 1
  • mushrum to @biscuitland/voice

    mushrum to @biscuitland/voice

    In terms of realization and ease. It has been decided to remove the mushrum repository, to be included within biscuitland.

    The goal is to provide an easy and simple to configure voice client (inspired by Erela.js) and adapted to the audio platform (and alternative to lavalink) mushroom.

    • @biscuitland/voice should provide an adapter just like all biscuitland packages.
    • @biscuitland/voice should add more properties and methods besides removing the send interpreter, to be compatible with biscuit only.
    • @biscuitland/voice should implement the operatorPlayer and operatorSpace methods to allow changes, edits and deletes.
    Feature Future major 
    opened by dragurimu 2
  • Bot is not running

    Bot is not running

    Hey everyone, I want to run this example with bun but it didn't work, why?

    code

    import { ChatInputApplicationCommandBuilder, Session } from "@biscuitland/core";
    import { GatewayIntents } from "@biscuitland/api-types";
    
    const session = new Session({
      token: "TOKEN",
      intents: GatewayIntents.Guilds,
    });
    
    const commands = [
      new ChatInputApplicationCommandBuilder()
        .setName("ping")
        .setDescription("Replys with pong!")
        .toJSON(),
    ];
    
    session.events.on("ready", async ({ user }) => {
      console.log("Logged in as:", user.username);
      await session.upsertApplicationCommands(commands, "GUILD_ID");
    });
    
    session.events.on("interactionCreate", (interaction) => {
      if (interaction.isCommand()) {
        if (interaction.commandName === "ping") {
          interaction.respond({ with: { content: "pong!" } });
        }
      }
    });
    
    session.start();
    

    output:

    Screenshot 2022-07-31 195957

    bun wont fix 
    opened by abdfnx 1
Releases(2.2.0)
  • 2.2.0(Nov 5, 2022)

    What's Changed

    • fix: avatarURL doesn't correctly return the default avatar by @Drylozu in https://github.com/oasisjs/biscuit/pull/119
    • release: v2.1.2 by @Drylozu in https://github.com/oasisjs/biscuit/pull/120
    • feat: first demo of the monthly update by @yuzudev in https://github.com/oasisjs/biscuit/pull/121
    • new select menus by @MARCROCK22 in https://github.com/oasisjs/biscuit/pull/122

    Full Changelog: https://github.com/oasisjs/biscuit/compare/2.1.0...2.2.0

    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Sep 16, 2022)

    What's Changed

    • fix: inconsistens imports by @socram03 in https://github.com/oasisjs/biscuit/pull/108
    • added missing url getters by @FreeAoi in https://github.com/oasisjs/biscuit/pull/112
    • feat: Guild Forums by @socram03 in https://github.com/oasisjs/biscuit/pull/113
    • refactor: channels.ts by @yuzudev in https://github.com/oasisjs/biscuit/pull/114

    New Contributors

    • @FreeAoi made their first contribution in https://github.com/oasisjs/biscuit/pull/112

    Full Changelog: https://github.com/oasisjs/biscuit/compare/2.0.6...2.1.0

    Source code(tar.gz)
    Source code(zip)
  • 2.0.6(Sep 3, 2022)

    What's Changed

    • Fix: Eslint and packages sizes by @socram03 in https://github.com/oasisjs/biscuit/pull/104
    • fix: NodeJS is not defined (eslint bug) by @yuzudev in https://github.com/oasisjs/biscuit/pull/106
    • fix: session can't runs without intents by @socram03 in https://github.com/oasisjs/biscuit/pull/107

    Full Changelog: https://github.com/oasisjs/biscuit/compare/2.0.5...2.0.6

    Source code(tar.gz)
    Source code(zip)
  • 2.0.5(Aug 31, 2022)

    It's been a while Breaking changes from 1.3 to 2.0

    - session.ws.agent.shards.values()
    + session.ws.shards.values()
    - shard.id
    + shard.options.id
    

    The rest of the library was not affected

    What's Changed

    • fix: update permissions strings by @socram03 in https://github.com/oasisjs/biscuit/pull/101

    Full Changelog: https://github.com/oasisjs/biscuit/compare/1.3.1...2.0.5

    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Aug 10, 2022)

  • 1.3.0(Aug 9, 2022)

    Overview

    • Fix for Guild.edit and add Guild.setPermissions
    • Add BaseChannel.delete.
    • Add Emoji.fetchAuthor and Emoji.toString.
    • Add Member.setNickname.
    • Refactor for interaction options.
    • Add DMChannel.group property.
    • General fixes for documentation and github community.

    What's Changed

    • fix(Guild.edit): id not received by @socram03 in https://github.com/oasisjs/biscuit/pull/93
    • Update channels, member and readme's by @nicolito128 in https://github.com/oasisjs/biscuit/pull/94
    • Create CODE_OF_CONDUCT.md by @nicolito128 in https://github.com/oasisjs/biscuit/pull/95
    • Remove old imports by @socram03 in https://github.com/oasisjs/biscuit/pull/97
    • Update DMChannel by @nicolito128 in https://github.com/oasisjs/biscuit/pull/98
    • Update Guild structure by @MARCROCK22 in https://github.com/oasisjs/biscuit/pull/96
    • feat(Emoji): Add Methods by @socram03 in https://github.com/oasisjs/biscuit/pull/99

    New Contributors

    • @MARCROCK22 made their first contribution in https://github.com/oasisjs/biscuit/pull/96

    Full Changelog: https://github.com/oasisjs/biscuit/compare/1.2.0...1.3.0

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Aug 3, 2022)

    • Features: method for User structure (openDM), voice events and collectors.
    • New submodule: helpers.
    • Documentation fixes and additions.
    • Fixes: Channels.fetch(), Message.edit/delete, rest.

    What's Changed

    • Update docs by @nicolito128 in https://github.com/oasisjs/biscuit/pull/84
    • feat(extra): collectors by @Drylozu in https://github.com/oasisjs/biscuit/pull/86
    • Methods for AutoModeration by @socram03 in https://github.com/oasisjs/biscuit/pull/90
    • Builders to helpers by @socram03 in https://github.com/oasisjs/biscuit/pull/91

    New Contributors

    • @Drylozu made their first contribution in https://github.com/oasisjs/biscuit/pull/86

    Full Changelog: https://github.com/oasisjs/biscuit/compare/1.1.0...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Jul 31, 2022)

    • Fix. shard-util.ts: remove shard.ready old method and use shard.isOpen.
    • Fix. StatusUpdate interface now accepts StatusTypes keys for status param.
    • Update channels. Add BaseChannel.fetch method. Add session property to CategoryChannel.
    • Update guilds. Add Guild.fetchMember, Guild.fetchChannel, Guild.setIcon and Guild.fetchChannels methods.
    • Update members. Add Member.fetch method.
    • Routes. Add GUILD_CHANNELS and GUILD_MEMBERS routes.
    • Add EventsKey type to core.

    New Contributors

    • @FabrizioCoder made their first contribution in https://github.com/oasisjs/biscuit/pull/82

    Full Changelog: https://github.com/oasisjs/biscuit/compare/1.0.0...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Jul 29, 2022)

    First stable version.

    • Use of turborepo for the organization of monorepo projects
    • New cache with several adapters possible.
    • Low level APIs refactoring.

    Full Changelog: https://github.com/oasisjs/biscuit/compare/0.2.4...1.0.0

    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Jul 18, 2022)

  • 0.2.0(Jul 18, 2022)

  • 0.1.1(Jul 14, 2022)

  • 0.1.0(Jul 13, 2022)

  • 0.1.0-rc8(Jul 12, 2022)

  • 0.1.0-rc7(Jul 8, 2022)

  • 0.1.0-rc6(Jul 8, 2022)

    • monorepo setup
    • fix: circular dependencies
    • feat: GuildChannel.edit
    • feat: ThreadChannel endpoints fixed and finished
    • most of the important parts of the api are covered
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0-rc5(Jul 6, 2022)

  • 0.1.0-rc4(Jul 4, 2022)

  • 0.1.0-rc3(Jul 4, 2022)

  • 0.1.0-rc2(Jul 3, 2022)

  • 0.1.0-rc1(Jul 2, 2022)

We are a group of videogame URJC students making a brand new Phaser3.0 browser multiplayer game. Come and support us!

COOKIE MAYHEM - JUEGOS EN RED Este proyecto está sujeto a cambios. Somos un grupo de estudiantes de Diseño y Desesarrollo de Videojuegos en la Univers

null 6 Dec 19, 2022
Adjust the appearance and content of the booking pages to your brand and services.

Timerise open source booking page We are pleased to provide our booking page in open-source. We hope it will be useful in your use case. It can be emb

Timerise 14 Dec 12, 2022
Cutting-edge Development Pushes for new Koders' Website

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Koders 5 Dec 27, 2022
An unreliable and overall unusable sorting library for numbers with a global cache on the edge.

unsort An unreliable and overall unusable sorting library for numbers with a global cache on the edge. the algorithm This library implements a number

Jonas Wanner 6 May 19, 2022
Duckhunt en javascript, HTML, CSS (projet non terminé)

Duckhunt.JS 1.0 Une réalisation personnel du jeu duckhunt réadapter à ma façon. Dans le cadre d'un cours de POO à l'école Metz Numeric School Histoire

BREGLER Thomas 3 Dec 2, 2022
KWin Script to switch to the next or previous non empty virtual desktop

kwin-cycle-non-empty-desktops KWin Script to switch to the next or previous non empty virtual desktop. Installation Method 1: From the KDE Store Go to

Shaan Subbaiah 1 Dec 5, 2022
An non-official esx-legacy 1.5 version for quasar inventory purpose.

Hi there ! It's my first post on github, and I'm releasing a free edited base with esx-legacy 1.5 compatible and made for Quasar Inventory. How can I

ChernyyOrel 3 Mar 19, 2022
Non-interactive publicly verifiable distributed key generation and resharing algorithm over BLS12-381

NPVDKG-RS This repository contains a mathematical presentation and some code to demonstrate our developed non-interactive publicly verifiable distribu

NATRIX Official 8 May 19, 2022
Browse local files using the non-standard Web Browser File System Access API

Browse local files using the non-standard Web Browser File System Access API

Jeremy Tuloup 16 Oct 26, 2022
[Experimental] Browse local files using the non-standard File System Access API

jupyterlab-filesystem-access Browse local files using the non-standard Web Browser File System Access API. ⚠️ This extension is compatible with Chromi

Jeremy Tuloup 0 Apr 14, 2022
A simple template to get started with a non-profit website.

Next.js Non-Profit Website A non-profit website template powered by the Cosmic headless CMS. Uses Next.js, Tailwind CSS, and Stripe for donation payme

Cosmic 5 Sep 6, 2022
[Experimental] Browse local files using the non-standard File System Access API

jupyterlab-filesystem-access Browse local files using the non-standard Web Browser File System Access API. ⚠️ This extension is compatible with Chromi

JupyterLab Unofficial Extensions & Tools 12 Apr 15, 2022
DecentraMix.io is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance

DecentraMix.io is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance. DecentraWorld applies zkSNARKs to enable transactional privacy for all DeFi components by breaking the on-chain link between depositor and recipient addresses.

DecentraWorld Ecosystem 65 May 7, 2022
🚀🚀 A Shopify App template for serverless, non-embedded Apps.

?? Free Shopify x Next.js App Template for serverless non-embedded Apps Everything to build your next non-embedded Shopify App and Marketing pages in

Carsten Lebek 77 Dec 30, 2022
An Obsidian plugin for automatically creating notes when linking to non-existing notes

Note Auto Creator for Obsidian Automatically create notes when links are created to them. How to use After enabling the plugin in the settings menu, y

Simon Clement 31 Dec 14, 2022
The project focused on creating To do list structure for organising the daily completed or non-completed activities.

Project to build a simple HTML list of To Do tasks. The list will be styled according to the specifications given by Microverse This simple web page will be built using webpack and served by a webpack dev server.

NTIHINDUKA ALPHA 5 May 20, 2022
Minty is an example of how to mint non-fungible tokens (NFTs) while storing the associated data on IPFS

Minty is an example of how to mint non-fungible tokens (NFTs) while storing the associated data on IPFS. You can also use Minty to pin your data on an IPFS pinning service such as nft.storage and Pinata.

One & Zeros 10 Nov 12, 2022
Marry in Web3, Mint Paired Soulbound NFTs by MultiSign Flow, No transfer, No sell, a non-financial Dapp

ERC721-520 Token 是 NFT-like Soulbound Token Standard(灵魂绑定凭证) 的一种实现,是 ERC721 标准的扩展。 ERC721-520 Token 不可转让,不可售卖,一个人同时只能有一个有效 Token ERC721-520 Token 由二者通

Marry3 48 Dec 21, 2022