Git Product home page Git Product logo

tiny-discord's Introduction

Tiny Discord

A high performance zero dependency raw library for interacting with the Discord API.

This project aims to provide a basic platform for building high-efficiency bots and libraries in NodeJS. Its base components are plug and play standalone files fully written with core node.js modules, without a single third-party dependency, and consistently outperform other more established solutions.

Tests and contributions are welcome.

To Do

  • Rest Client
  • Interaction Server
  • Shard Websocket
  • Identify Controller
  • Voice Websocket?
  • Basic Caching?
  • Basic types
  • Internal Sharder
  • External Sharder
  • Ratelimit Manager?
  • Docs
  • Benchmarks

Not everyting in this list is guaranteed to be done. items in questionmarks are ideas and possibilities but not a priority and not necessarily something that will be part of this project.

Docs

  • Base components (standalone classes with zero dependencies)
    • RestClient - An http client for interacting with the discord rest API.
    • WebsocketShard - A websocket client to receive real-time events from discord.
    • InteractionServer - A webhook server for receiving Discord interactions.
  • Utility components (higher level classes built on top of one or more base components)

Benchmarks

The following benchmark shows how many events per second can each library process with a single shard. It demonstrates the performance advantages of using the raw discord data directly as opposed to transforming it into complex classes and structures.

test/lib discord.js eris detritus tiny-discord
guilds json 976 1346 803 2479
guilds json+zlib 949 1403 716 2601
guilds etf 681 705 500 2147
guilds etf+zlib 602 808 514 1943
messages json 29482 31759 8081 56917
messages json zlib 25986 22898 5271 39353
messages etf 17684 18003 7505 30621
messages etf zlib 15562 14559 4005 26631

Full benchmark can be found here: https://github.com/timotejroiko/discord-websocket-benchmark

Sponsors

Special thanks to our sponsors!

LICENSE

This project is licensed under MIT, which basically means you can do anything you want with it, i only ask that you include a small copyright notice and a link to this repo in a comment in your source code.

tiny-discord's People

Contributors

itsmishra19 avatar jacobk999 avatar timotejroiko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tiny-discord's Issues

"discord actually does send messages with fin=0. if you see this error let me know"

/home/danny/Documents/Projects/discord-plexamp-status/node_modules/tiny-discord/src/WebsocketShard.js:638
                        if(fin !== 1 || opcode === 0) { throw new Error("discord actually does send messages with fin=0. if you see this error let me know"); }
                                                        ^

Error: discord actually does send messages with fin=0. if you see this error let me know
    at WebsocketShard._onReadable (/home/danny/Documents/Projects/discord-plexamp-status/node_modules/tiny-discord/src/WebsocketShard.js:638:42)
    at TLSSocket.emit (node:events:517:28)
    at emitReadable_ (node:internal/streams/readable:633:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Node.js v18.20.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.