Package Exports
- discord-dependless
- discord-dependless/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discord-dependless) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
Result
handling 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@v10
Versioning
This package follows Discord's REST API versioning. The version tag reflects the API version being utilized:
@v10
uses 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>" });
await Result.unwrap(bot.sendMessage("channelId", {
embeds: [
{
title: "Embed Title",
description: "Super Duper Description",
color: 0x000000
}
]
}));
Expects all snowflake types as number strings, following Discord's Rest API
Result.unwrap
unwrap 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
Result
type 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
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. 🚀