discord-dependless
v10.0.0-alpha.8
Published
A lightweight Discord API wrapper designed for simplicity and zero active dependencies. Unlike traditional libraries, **discord-dependless** allows sending messages persistent connection and gateway events are optional.
Maintainers
Readme
⚠️ Alpha Version Prerelease ⚠️
Discord-Dependless
A lightweight Discord API wrapper designed for simplicity and zero active dependencies. Unlike traditional libraries, discord-dependless allows sending messages persistent connection and gateway events are optional.
Github
https://github.com/conmaster2112/discord-dependless
Features
- Zero Dependencies – Fully functional without external dependencies.
- REST API Integration – Utility API functions without logging in.
- Strongly Typed Core APIs – Inner APIs are build on strong typing system.
- Result with Error Pattern – Inspired by Rust's
Resulthandling to avoid unexpected crashes/throws. - Event Handling – Supports all Discord events (though not strictly typed yet).
- Without WebAPIs Potential – Can be used with custom fetch methods by overwriting static apis functions
Installation
npm install discord-dependless@v10Versioning
This package follows Discord's REST API versioning. The version tag reflects the API version being utilized:
@v10uses Discord REST API v10. (Current Active Development)- Future versions will continue to align with Discord's latest REST API updates.
Usage
Basic example of sending a message with an embed:
import { Bot, Result } from "discord-dependless";
const bot = new Bot({ token: "<your-token-here>" });
const result = await bot.sendMessage("channelId", {
embeds: [
{
title: "Embed Title",
description: "Super Duper Description",
color: 0x000000
}
]
});
//Throw if something went wrong
result.unwrap();Expects all snowflake types as number strings, following Discord's Rest API
Result.unwrapunwrap used in this example to directly throws error if bot failed to send message.
Why Use This?
- No need for persistent connections.
- Easier debugging compared to traditional Discord.js.
- Ideal for lightweight applications that only require few features
Notes
- Events are available but not strictly typed yet.
- The package's structure is inspired by Rust's
Resulttype to improve error handling. - Use
Result.unwrap()if you like throwing stuff :)
Roadmap
- Further optimization and testing without hardcoded Web APIs.
- Improve event typing.
- Additional utility functions to enhance Discord interactions
Changes
10.0.0-alpha.8- Updated Rest API endpoints, improved treeshake-ability of the overall code.
- Add rate-limiting logic and preventing lost of requests.
10.0.0-alpha.7- Fixed code-gen cursed event name, for gateway events.
10.0.0-alpha.6- Fixed Heartbeat connection, results with stronger and more established connection.
- Improved NodeJS compatibility with simple ErrorEvent implementation fallback.
10.0.0-alpha.5- Add More Gateway Events
- Types for Ready Event
- Types for InteractionCreate Event
- Add More Gateway Events
10.0.0-alpha.4- Added exported namespace
JsonAPIfor All JSON Rest API function builders - Improved DiscordAPIError Instance with improved experimental formatting
- Made Bot class instance to use
JsonAPIunder the hood and added setApplicationCommands method
- Added exported namespace
Contribution
Contributions are always welcome! Whether you want to improve the package, optimize code, or suggest features, you can contribute in two ways:
- Pull Requests – Submit changes or enhancements via pull requests.
- Issue Reporting – If you encounter bugs or have suggestions, feel free to open an issue.
Your feedback helps make discord-dependless better. 🚀
