- 20.0.0Latest
- 19.0.0
- 18.0.1
- 18.0.0
- 17.2.0
- 17.0.1
- 17.1.0
- 17.0.0
- 16.0.1
- 16.0.0
- 15.0.3
- 15.0.2
- 15.0.1
- 15.0.0
- 14.0.1
- 14.0.0
- 13.0.0
- 13.0.0-rc51
- 13.0.0-rc50
- 13.0.0-rc49
- 13.0.0-rc48
- 13.0.0-rc47
- 13.0.0-rc46
- 13.0.0-rc45
- 13.0.0-rc44
- 13.0.0-rc43
- 13.0.0-rc42
- 13.0.0-rc41
- 13.0.0-rc40
- 13.0.0-rc39
- 13.0.0-rc38
- 13.0.0-rc37
- 13.0.0-rc36
- 13.0.0-rc35
- 13.0.0-rc34
- 13.0.0-rc33
- 13.0.0-rc32
- 13.0.0-rc31
- 13.0.0-rc30
- 13.0.0-rc29
- 13.0.0-rc28
- 13.0.0-rc27
- 13.0.0-rc26
- 13.0.0-rc25
- 13.0.0-rc24
- 13.0.0-rc23
- 13.0.0-rc22
- 13.0.0-rc21
- 13.0.0-rc20
- 13.0.0-rc19
- 13.0.0-rc18
- 13.0.0-rc17
- 13.0.0-rc16
- 13.0.0-rc15
- 13.0.0-rc14
- 13.0.0-rc13
- 13.0.0-rc12
- 13.0.0-rc11
- 13.0.0-rc10
- 13.0.0-rc9
- 13.0.0-rc8
- 13.0.0-rc7
- 13.0.0-rc6
- 13.0.0-rc5
- 13.0.0-rc4
- 13.0.0-rc3
- 13.0.0-rc2
- 13.0.0-rc1
- 12.0.1
- 12.0.0
- 12.0.0-rc.5
- 12.0.0-rc.4
- 12.0.0-rc.3
- 12.0.0-rc.2
- 12.0.0-rc.1
- 11.2.0
- 11.1.0
- 11.0.3
- 11.0.2
- 11.0.1
- 11.0.0
- 11.0.0-rc.10
- 11.0.0-rc.9
- 11.0.0-rc.8
- 11.0.0-rc.7
- 11.0.0-rc.6
- 11.0.0-rc.5
- 11.0.0-rc.4
- 11.0.0-rc.3
- 11.0.0-rc.2
- 11.0.0-rc.1
- 10.5.0
- 10.4.0
- 10.3.0
- 10.2.0
- 10.1.0
- 10.0.2
- 10.0.1
- 10.0.0
- 9.4.1
- 9.4.0
- 9.3.0
- 9.2.0
- 9.1.0
- 9.0.16
- 9.0.15
- 9.0.14
- 9.0.12
- 9.0.10
- v9.0.9
- v9.0.8
- v9.0.7
- v9.0.6
- v9.0.5
- v9.0.4
- v9.0.1
- v8.4.1
- v8.0.0
- v7.4.0
- v7.3.0
- v7.0.1
- v7.0.0
- v6.2.0
- v6.1.2
- v6.1.1
- v6.1.0
- v6.0.0
- v5.1.1
- v5.1.0
- v5.0.0
- v4.0.1
- v4.0.0
- v3.0.0
- v2.0.0
Discordeno
Discord API library for Node.JS, Deno & Bun
Tips
- If you are already convinced about using Discordeno, go to Getting Started
- To learn if Discordeno is right for you, read everything below.
Packages
Package | npm | Tests |
---|---|---|
discordeno | ||
@discordeno/types | ||
@discordeno/utils | ||
@discordeno/rest | ||
@discordeno/gateway | ||
@discordeno/bot |
Features
Discordeno is actively maintained to guarantee excellent performance, latest features, and ease of use.
- Simple, Efficient, and Lightweight: Discordeno is lightweight, simple to use, and adaptable.
- By default: No caching.
- Functional API:
- The functional API eliminates the challenges of extending built-in classes and inheritance while ensuring overall simple but performant code.
- Cross Runtime: Supports the Node.js, Deno, and Bun runtimes.
- Standalone components: Discordeno offers the option to have practically any component of a bot as a separate piece, including standalone REST, gateways, custom caches, and more.
- Flexibility/Scalability: Remove any properties, if your bot doesn’t need them. For instance, remove
Channel.topic
if your bot doesn’t require it. You may save GBs of RAM in this way. A few lines of code are all that are needed to accomplish this for any property on any object.
REST
- Freedom from 1 hour downtimes due to invalid requests
- Prevent your bot from being down for an hour, by lowering the maximum downtime to 10 minutes.
- Freedom from global rate limit errors
- As a bot grows, you need to handle global rate limits better. Shards don’t communicate fast enough to truly handle it properly. With one point of contact to discords API, you will never have issues again.
- Numerous instances of your bot on different hosts, all of which can connect to the same REST server.
- REST does not rest!
- Separate rest guarantees that your queued requests will continue to be processed even if your bot breaks for whatever reason.
- Seamless updates! When updating/restarting a bot, you’ll lose a lot of messages or replies that are queued/processing.
- Single point of contact to Discord API
- Send requests from any location, even a bot dashboard directly.
- Don’t send requests from dashboard to bot process to send a request to discord. Your bot process should be freed up to handle bot events!
- Scalability! Scalability! Scalability!
Gateway
- Zero Downtime Updates:
- Others: With non-proxy bots, it takes about 5s per shard bucket to start up. With 100,000 servers, this would be minimum of 8+ minutes of downtime for bot updates.
- Discordeno Proxy Gateway: Resume the bot code almost instantly without worrying about any delays or wasting your identify limits.
- Zero Downtime Resharding:
- Discord stops allowing your bot to be added to new servers when you max out your existing max shards. Consider a bot started with 150 shards operating on 150,000 servers. Your shards support a maximum of 150 * 2500 = 375,000 servers. Your bot will be unable to join new servers once it reaches this point until it re-shards.
- DD proxy provides 2 types of re-sharding. Automated and manual. You can also have both.
- Automated: This system will automatically begin a Zero-downtime resharding process behind the scenes when you
reach 80% of your maximum servers allowed by your shards. For example, since 375,000 was the max, at 300,000 we
would begin re-sharding behind the scenes with ZERO DOWNTIME.
- 80% of maximum servers reached (The % of 80% is customizable.)
- Identify limits have room to allow re-sharding. (Also customizable)
- Manual: You can also trigger this manually should you choose.
- When discord releases a new API version, updates your gateways to new version with no downtime.
- Automated: This system will automatically begin a Zero-downtime resharding process behind the scenes when you
reach 80% of your maximum servers allowed by your shards. For example, since 375,000 was the max, at 300,000 we
would begin re-sharding behind the scenes with ZERO DOWNTIME.
- Horizontal Scaling:
- When your bot grows a lot, you have two options: you can either keep investing money to upgrade your server or you may expand horizontally by purchasing several more affordable servers. The proxy enables WS handling on multiple servers.
- No Loss Restarts:
- Without the proxy mechanism, you would typically lose a lot of events while restarting. Users could issue instructions or send messages that are not automoderated. As your bot grows, this amount grows sharply. Users who don’t receive the automatic roles or any other activities your bot should do.
- While your bot is unavailable, events can be added to a queue, and once the bot is back online, the queue will start processing all of the events.
- Flexibility:
- You have complete control over everything inside the gateway thanks to the controller aspect. Need to customize, the way the manager talks to the workers? Simply, plug in and override the method.
- Clustering With Workers:
- Utilize all of your CPU cores to their greatest potential by distributing the workload across workers. To enhance efficiency, manage how shards per worker.
Custom Cache
Have your cache setup in any way you like. Redis, PGSQL or any cache layer you would like.
Getting Started
Interested? Check the website for more details on getting started.
Links
Discordeno follows semantic versioning
Contributing/Developing
We use yarn as package manager and workspace manager, and turborepo as monorepo manager.
To config the workspace run
# if you don't have yarn installed
npm install -g yarn
yarn install
Then you can build all the files and types across all packages using (unless specified all commands below are run at root directory)
yarn release-build
You can run unit tests on all packages using
yarn test:unit
Other useful information are available on the website under the contributing documentation
Other useful scripts (if you run in the package’s directory, you need build dist before for test and types before for lint/fmt. Running in root directory should automatically do it for you)
# check style
yarn lint
# format code
yarn fmt
# check type
yarn test:type
# check type for tests
yarn test:test-type
# unit test showing coverage
yarn test:unit-coverage
# unit test with Deno
yarn test:deno-unit
# unit test with Bun
yarn test:bun-unit
# integration test
yarn test:integration
# e2e test
yarn test:e2e
# build doc for website
yarn build:doc