mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
fix(website): fix typedoc configuration (#3733)
* Fix typedoc CI crashse And adapt the website to its new output * Revert /tsconfig.json changes * Update footer
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -15,11 +15,10 @@ node_modules
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
website/api_reference/generated/classes/*.md
|
||||
website/api_reference/generated/enums/*.md
|
||||
website/api_reference/generated/interfaces/*.md
|
||||
website/api_reference/generated/modules/*.md
|
||||
website/.yarn/
|
||||
website/.yarn
|
||||
|
||||
website/api_reference/generated/**/*.md
|
||||
|
||||
# testing
|
||||
coverage
|
||||
|
||||
|
||||
18
README.md
18
README.md
@@ -1,6 +1,6 @@
|
||||
# Discordeno
|
||||
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px">
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px" />
|
||||
|
||||
Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land) & [Bun](https://bun.sh/)
|
||||
|
||||
@@ -15,14 +15,14 @@ Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land)
|
||||
|
||||
## Packages
|
||||
|
||||
| Package | npm | Tests |
|
||||
| ------------------------------------------------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [discordeno](https://www.npmjs.com/package/discordeno) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/types](https://www.npmjs.com/package/@discordeno/types) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/utils](https://www.npmjs.com/package/@discordeno/utils) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/rest](https://www.npmjs.com/package/@discordeno/rest) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/gateway](https://www.npmjs.com/package/@discordeno/gateway) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/bot](https://www.npmjs.com/package/@discordeno/bot) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| Package | npm | Tests |
|
||||
| ------------------------------------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [discordeno](https://www.npmjs.com/package/discordeno) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/types](https://www.npmjs.com/package/@discordeno/types) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/utils](https://www.npmjs.com/package/@discordeno/utils) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/rest](https://www.npmjs.com/package/@discordeno/rest) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/gateway](https://www.npmjs.com/package/@discordeno/gateway) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
| [@discordeno/bot](https://www.npmjs.com/package/@discordeno/bot) |  | [](https://codecov.io/gh/discordeno/discordeno) |
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
"lint-staged": "^15.2.7",
|
||||
"prettier": "^3.2.5",
|
||||
"turbo": "^1.11.3",
|
||||
"typedoc": "^0.26.3",
|
||||
"typedoc-plugin-markdown": "3.17.1",
|
||||
"typedoc": "^0.26.4",
|
||||
"typedoc-plugin-markdown": "^4.1.2",
|
||||
"typescript": "^5.5.3"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
30
packages/bot/README.md
Normal file
30
packages/bot/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Discordeno
|
||||
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px" />
|
||||
|
||||
Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land) & [Bun](https://bun.sh/)
|
||||
|
||||
[](https://discord.com/invite/5vBgXk3UcZ)
|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||

|
||||
|
||||
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.
|
||||
|
||||
### Custom Cache
|
||||
|
||||
Have your cache setup in any way you like. Redis, PGSQL or any cache layer you would like.
|
||||
|
||||
## Links
|
||||
|
||||
- [Website](https://discordeno.js.org/)
|
||||
- [Documentation](https://doc.deno.land/https/deno.land/x/discordeno/mod.ts)
|
||||
- [Discord](https://discord.com/invite/5vBgXk3UcZ)
|
||||
@@ -1,8 +1,17 @@
|
||||
# Standalone WS / Proxy WS
|
||||
# Discordeno WS
|
||||
|
||||
This WS service is meant for ADVANCED DEVELOPERS ONLY!
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px" />
|
||||
|
||||
## Benefits
|
||||
Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land) & [Bun](https://bun.sh/)
|
||||
|
||||
[](https://discord.com/invite/5vBgXk3UcZ)
|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||

|
||||
|
||||
> [!WARNING]
|
||||
> Using a Standalone / Proxy WS is mean for advanced developers only
|
||||
|
||||
Standalone WebSocket to connect to the Discord API.
|
||||
|
||||
- **Zero Downtime Updates**:
|
||||
|
||||
@@ -48,14 +57,8 @@ This WS service is meant for ADVANCED DEVELOPERS ONLY!
|
||||
- Take full advantage of all your CPU cores by using workers to spread the load. Control how many shards per worker
|
||||
and how many workers to maximize efficiency!
|
||||
|
||||
## Usage
|
||||
## Links
|
||||
|
||||
```ts
|
||||
createGatewayManager({
|
||||
// TODO: (docs) Fill this out
|
||||
})
|
||||
```
|
||||
|
||||
## API/Docs
|
||||
|
||||
// TODO: (docs) Fill this out. List all props/methods.
|
||||
- [Website](https://discordeno.js.org/)
|
||||
- [Documentation](https://doc.deno.land/https/deno.land/x/discordeno/mod.ts)
|
||||
- [Discord](https://discord.com/invite/5vBgXk3UcZ)
|
||||
|
||||
@@ -712,7 +712,7 @@ export interface GatewayManager extends Required<CreateGatewayManagerOptions> {
|
||||
* Edits the bot status in all shards that this gateway manages.
|
||||
*
|
||||
* @param data The status data to set the bots status to.
|
||||
* @returns Promise<void>
|
||||
* @returns nothing
|
||||
*/
|
||||
editBotStatus: (data: StatusUpdate) => Promise<void>
|
||||
/**
|
||||
@@ -720,7 +720,7 @@ export interface GatewayManager extends Required<CreateGatewayManagerOptions> {
|
||||
*
|
||||
* @param shardId The shard id to edit the status for.
|
||||
* @param data The status data to set the bots status to.
|
||||
* @returns Promise<void>
|
||||
* @returns nothing
|
||||
*/
|
||||
editShardStatus: (shardId: number, data: StatusUpdate) => Promise<void>
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
# Discordeno Rest
|
||||
|
||||
A standalone and server-less REST module with functionality of REST, independently.
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px" />
|
||||
|
||||
Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land) & [Bun](https://bun.sh/)
|
||||
|
||||
[](https://discord.com/invite/5vBgXk3UcZ)
|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||

|
||||
|
||||
A standalone REST module with functionality of REST, independently.
|
||||
|
||||
- Easily host on any serverless infrastructure.
|
||||
- Easy to use and setup with Cloudflare Workers (FREE for 100K requests per day!)
|
||||
@@ -14,3 +22,9 @@ A standalone and server-less REST module with functionality of REST, independent
|
||||
- Seamless updates! When you want to update and reboot the bot, you could potentially lose tons of messages or
|
||||
responses that are in queue. Using this you could restart your bot without ever worrying about losing any responses.
|
||||
- Scalability! Scalability! Scalability!
|
||||
|
||||
## Links
|
||||
|
||||
- [Website](https://discordeno.js.org/)
|
||||
- [Documentation](https://doc.deno.land/https/deno.land/x/discordeno/mod.ts)
|
||||
- [Discord](https://discord.com/invite/5vBgXk3UcZ)
|
||||
|
||||
@@ -1,151 +1,14 @@
|
||||
# Discordeno
|
||||
# Discordeno Utils
|
||||
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/site/static/img/logo.png" height="150px">
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px" />
|
||||
|
||||
Discord API library for [Deno](https://deno.land)
|
||||
|
||||
Discordeno follows [semantic versioning](https://semver.org/)
|
||||
Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land) & [Bun](https://bun.sh/)
|
||||
|
||||
[](https://discord.com/invite/5vBgXk3UcZ)
|
||||

|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
Discordeno is actively maintained to guarantee **excellent performance and ease.**
|
||||
|
||||
- **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 and Deno 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.
|
||||
- **Plugins:** Designed to allow you to overwrite any portion of the code with your own code. Never go through the
|
||||
hassle of maintaining your fork in order to acquire something that is specifically tailored to your requirements.
|
||||
Plugins may be used for nearly anything; for instance, we have a few authorised plugins.
|
||||
|
||||
- A caching plugin that makes anything cacheable.
|
||||
- A plugin for sweepers that allows them to periodically clear the cache.
|
||||
- The permission plugin internally verifies any missing permissions before sending a call to the Discord API to
|
||||
prevent the client from receiving a Discord global ban.
|
||||
|
||||
- **Flexibility:** You may easily delete an object's attributes if your bot doesn't require them. For instance, you
|
||||
shouldn't be required to keep `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
|
||||
- By lowering the maximum downtime to 10 minutes, Discordeno will prevent your bot from being down for an hour.
|
||||
- Freedom from global rate limit errors
|
||||
- As your bot grows, you want to handle global rate limits better. Shards don't communicate fast enough to truly
|
||||
handle it properly so this allows 1 rest handler across the entire bot.
|
||||
- You may really run numerous instances of your bot on different hosts, all of which will 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! There's a chance you'll lose a lot of messages or replies that are waiting to be given when you
|
||||
wish to update and restart the bot. You may restart your bot using this technique and never have to worry about
|
||||
losing any answers.
|
||||
- Single source of contact to Discord API
|
||||
- As a result, you will be able to send requests to Discord from any location, even a bot dashboard. You are no longer
|
||||
need to interact with your bot processes in order to submit a request or do anything else. Your bot process should
|
||||
be freed up to handle bot events.
|
||||
- Scalability! Scalability! Scalability!
|
||||
|
||||
### Gateway
|
||||
|
||||
- **Zero Downtime Updates:**
|
||||
- A few seconds are needed to update your bot. When using conventional sharding, you must restart in addition to going
|
||||
through a 1/5s rate-limited process of identifying all of your shards. As WS processing has been relocated to a
|
||||
proxy process, you may resume the bot code right away without worrying about any delays. Normally, if you had a bot
|
||||
that was spread across 200,000 servers, restarting it after making a simple modification would take 20 minutes.
|
||||
- **Zero Downtime Resharding:**
|
||||
- At various periods in time, Discord stops allowing your bot to be added to new servers. Consider 150 shards
|
||||
operating on 150,000 servers, for instance. Your shards may 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.
|
||||
- **Horizontal Scaling:**
|
||||
- The bot may be scaled horizontally thanks to the proxy mechanism. When your business grows significantly, you have
|
||||
two options: you can either keep investing money to upgrade your server or you may expand horizontally by purchasing
|
||||
numerous more affordable servers. The proxy enables WS handling on a totally other system.
|
||||
- **No Loss Restarts:**
|
||||
- Without the proxy mechanism, you would typically lose numerous events while restarting a bot. Users could issue
|
||||
instructions or send messages that are not screened. As your bot population increases, this amount grows sharply.
|
||||
Users who don't receive the automatic roles or any other activities your bot should do may join. You may keep
|
||||
restarting your bot thanks to the proxy technology without ever losing any events. While your bot is unavailable,
|
||||
events will be added to a queue (the maximum size of the queue is configurable), and once the bot is back online,
|
||||
the queue will start processing all of the events.
|
||||
- **Controllers:**
|
||||
- You have complete control over everything inside the proxy thanks to the controller aspect. To simply override the
|
||||
handler, you may supply a function. For instance, you may simply give a method to override a specific function if
|
||||
you want it to behave differently rather than forking and maintaining your fork.
|
||||
- **Clustering With Workers:**
|
||||
- Utilize all of your CPU cores to their greatest potential by distributing the workload across employees. To enhance
|
||||
efficiency, manage how many employees and shards there are each worker!
|
||||
|
||||
### Custom Cache
|
||||
|
||||
Have your cache setup in any way you like. Redis, PGSQL or any cache layer you would like.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Minimal Example
|
||||
|
||||
Here is a minimal example to get started with:
|
||||
|
||||
```typescript
|
||||
import { createBot, Intents, startBot } from 'https://deno.land/x/discordeno@13.0.0/mod.ts'
|
||||
|
||||
const bot = createBot({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: Intents.Guilds | Intents.GuildMessages,
|
||||
events: {
|
||||
ready() {
|
||||
console.log('Successfully connected to gateway')
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Another way to do events
|
||||
bot.events.messageCreate = function (b, message) {
|
||||
// Process the message here with your command handler.
|
||||
}
|
||||
|
||||
await startBot(bot)
|
||||
```
|
||||
|
||||
### Tools
|
||||
|
||||
This library is not intended for beginners, however if you still want to utilise it, check out these excellent official
|
||||
and unofficial templates:
|
||||
|
||||
**Templates**
|
||||
|
||||
- [Discordeno Template (official)](https://github.com/discordeno/discordeno/tree/main/template)
|
||||
- [Serverless Slash Commands Template (official)](https://github.com/discordeno/serverless-deno-deploy-template)
|
||||
- [`create-discordeno-bot` (WIP, unoffical)](https://github.com/Reboot-Codes/create-discordeno-bot/)
|
||||
- [Add Your Own!](https://github.com/discordeno/discordeno/pulls)
|
||||
|
||||
**Frameworks**
|
||||
|
||||
- [Amethyst Framework](https://github.com/AmethystFramework/framework)
|
||||
- [Add Your Own!](https://github.com/discordeno/discordeno/pulls)
|
||||
|
||||
**Plugins**
|
||||
|
||||
- [Cache Plugin](plugins/cache)
|
||||
- [Fileloader Plugin](plugins/fileloader)
|
||||
- [Helpers Plugin](plugins/helpers)
|
||||
- [Permissions Plugin](plugins/permissions)
|
||||
Types used in Discordeno. Including Discord types
|
||||
|
||||
## Links
|
||||
|
||||
|
||||
@@ -1,151 +1,14 @@
|
||||
# Discordeno
|
||||
# Discordeno Utils
|
||||
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/site/static/img/logo.png" height="150px">
|
||||
<img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/website/static/img/logo.png" height="150px" />
|
||||
|
||||
Discord API library for [Deno](https://deno.land)
|
||||
|
||||
Discordeno follows [semantic versioning](https://semver.org/)
|
||||
Discord API library for [Node.JS](https://nodejs.org), [Deno](https://deno.land) & [Bun](https://bun.sh/)
|
||||
|
||||
[](https://discord.com/invite/5vBgXk3UcZ)
|
||||

|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||
[](https://codecov.io/gh/discordeno/discordeno)
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
Discordeno is actively maintained to guarantee **excellent performance and ease.**
|
||||
|
||||
- **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 and Deno 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.
|
||||
- **Plugins:** Designed to allow you to overwrite any portion of the code with your own code. Never go through the
|
||||
hassle of maintaining your fork in order to acquire something that is specifically tailored to your requirements.
|
||||
Plugins may be used for nearly anything; for instance, we have a few authorised plugins.
|
||||
|
||||
- A caching plugin that makes anything cacheable.
|
||||
- A plugin for sweepers that allows them to periodically clear the cache.
|
||||
- The permission plugin internally verifies any missing permissions before sending a call to the Discord API to
|
||||
prevent the client from receiving a Discord global ban.
|
||||
|
||||
- **Flexibility:** You may easily delete an object's attributes if your bot doesn't require them. For instance, you
|
||||
shouldn't be required to keep `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
|
||||
- By lowering the maximum downtime to 10 minutes, Discordeno will prevent your bot from being down for an hour.
|
||||
- Freedom from global rate limit errors
|
||||
- As your bot grows, you want to handle global rate limits better. Shards don't communicate fast enough to truly
|
||||
handle it properly so this allows 1 rest handler across the entire bot.
|
||||
- You may really run numerous instances of your bot on different hosts, all of which will 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! There's a chance you'll lose a lot of messages or replies that are waiting to be given when you
|
||||
wish to update and restart the bot. You may restart your bot using this technique and never have to worry about
|
||||
losing any answers.
|
||||
- Single source of contact to Discord API
|
||||
- As a result, you will be able to send requests to Discord from any location, even a bot dashboard. You are no longer
|
||||
need to interact with your bot processes in order to submit a request or do anything else. Your bot process should
|
||||
be freed up to handle bot events.
|
||||
- Scalability! Scalability! Scalability!
|
||||
|
||||
### Gateway
|
||||
|
||||
- **Zero Downtime Updates:**
|
||||
- A few seconds are needed to update your bot. When using conventional sharding, you must restart in addition to going
|
||||
through a 1/5s rate-limited process of identifying all of your shards. As WS processing has been relocated to a
|
||||
proxy process, you may resume the bot code right away without worrying about any delays. Normally, if you had a bot
|
||||
that was spread across 200,000 servers, restarting it after making a simple modification would take 20 minutes.
|
||||
- **Zero Downtime Resharding:**
|
||||
- At various periods in time, Discord stops allowing your bot to be added to new servers. Consider 150 shards
|
||||
operating on 150,000 servers, for instance. Your shards may 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.
|
||||
- **Horizontal Scaling:**
|
||||
- The bot may be scaled horizontally thanks to the proxy mechanism. When your business grows significantly, you have
|
||||
two options: you can either keep investing money to upgrade your server or you may expand horizontally by purchasing
|
||||
numerous more affordable servers. The proxy enables WS handling on a totally other system.
|
||||
- **No Loss Restarts:**
|
||||
- Without the proxy mechanism, you would typically lose numerous events while restarting a bot. Users could issue
|
||||
instructions or send messages that are not screened. As your bot population increases, this amount grows sharply.
|
||||
Users who don't receive the automatic roles or any other activities your bot should do may join. You may keep
|
||||
restarting your bot thanks to the proxy technology without ever losing any events. While your bot is unavailable,
|
||||
events will be added to a queue (the maximum size of the queue is configurable), and once the bot is back online,
|
||||
the queue will start processing all of the events.
|
||||
- **Controllers:**
|
||||
- You have complete control over everything inside the proxy thanks to the controller aspect. To simply override the
|
||||
handler, you may supply a function. For instance, you may simply give a method to override a specific function if
|
||||
you want it to behave differently rather than forking and maintaining your fork.
|
||||
- **Clustering With Workers:**
|
||||
- Utilize all of your CPU cores to their greatest potential by distributing the workload across employees. To enhance
|
||||
efficiency, manage how many employees and shards there are each worker!
|
||||
|
||||
### Custom Cache
|
||||
|
||||
Have your cache setup in any way you like. Redis, PGSQL or any cache layer you would like.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Minimal Example
|
||||
|
||||
Here is a minimal example to get started with:
|
||||
|
||||
```typescript
|
||||
import { createBot, Intents, startBot } from 'https://deno.land/x/discordeno@13.0.0/mod.ts'
|
||||
|
||||
const bot = createBot({
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: Intents.Guilds | Intents.GuildMessages,
|
||||
events: {
|
||||
ready() {
|
||||
console.log('Successfully connected to gateway')
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Another way to do events
|
||||
bot.events.messageCreate = function (b, message) {
|
||||
// Process the message here with your command handler.
|
||||
}
|
||||
|
||||
await startBot(bot)
|
||||
```
|
||||
|
||||
### Tools
|
||||
|
||||
This library is not intended for beginners, however if you still want to utilise it, check out these excellent official
|
||||
and unofficial templates:
|
||||
|
||||
**Templates**
|
||||
|
||||
- [Discordeno Template (official)](https://github.com/discordeno/discordeno/tree/main/template)
|
||||
- [Serverless Slash Commands Template (official)](https://github.com/discordeno/serverless-deno-deploy-template)
|
||||
- [`create-discordeno-bot` (WIP, unoffical)](https://github.com/Reboot-Codes/create-discordeno-bot/)
|
||||
- [Add Your Own!](https://github.com/discordeno/discordeno/pulls)
|
||||
|
||||
**Frameworks**
|
||||
|
||||
- [Amethyst Framework](https://github.com/AmethystFramework/framework)
|
||||
- [Add Your Own!](https://github.com/discordeno/discordeno/pulls)
|
||||
|
||||
**Plugins**
|
||||
|
||||
- [Cache Plugin](plugins/cache)
|
||||
- [Fileloader Plugin](plugins/fileloader)
|
||||
- [Helpers Plugin](plugins/helpers)
|
||||
- [Permissions Plugin](plugins/permissions)
|
||||
Utilities useful when using Discordeno.
|
||||
|
||||
## Links
|
||||
|
||||
|
||||
@@ -1,97 +1,18 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { writeFile } from 'node:fs/promises'
|
||||
import typedocConfig from '../typedoc.json' with { type: 'json' }
|
||||
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
const typedocOutPath = typedocConfig.out
|
||||
|
||||
// these two paths may vary depending on where you place this script, and your project structure including where typedoc generates its output files.
|
||||
const typedocOutPath = await import('../typedoc.json', { with: { type: 'json' } }).then((module) => module.default.out)
|
||||
|
||||
async function* walk(dir) {
|
||||
for await (const d of await fs.promises.opendir(dir)) {
|
||||
const entry = path.join(dir, d.name)
|
||||
if (d.isDirectory()) yield* walk(entry)
|
||||
else if (d.isFile()) yield entry
|
||||
}
|
||||
}
|
||||
|
||||
for await (let filepath of walk(typedocOutPath)) {
|
||||
if (filepath.endsWith('.json')) continue
|
||||
let file = fs.readFileSync(filepath, 'utf-8')
|
||||
|
||||
if (filepath.endsWith(`generated${path.sep}README.md`)) {
|
||||
file = [
|
||||
'discordeno-monorepo / [Modules](modules.md)',
|
||||
'',
|
||||
'# Discordeno',
|
||||
'',
|
||||
'Thank you for using Discordeno. These docs are generated automatically. If you see any issues please contact us on [Discord](https://discord.gg/ddeno)',
|
||||
'',
|
||||
].join('\n')
|
||||
}
|
||||
|
||||
if (filepath.endsWith(`generated${path.sep}modules.md`)) {
|
||||
file = [
|
||||
'[discordeno-monorepo](README.md) / Modules',
|
||||
'',
|
||||
'# discordeno-monorepo',
|
||||
'',
|
||||
'## Table of contents',
|
||||
'',
|
||||
'### Modules',
|
||||
'',
|
||||
'- [@discordeno/bot](modules/Bot)',
|
||||
'- [@discordeno/gateway](modules/Gateway)',
|
||||
'- [@discordeno/rest](modules/Rest)',
|
||||
'- [@discordeno/types](modules/Types)',
|
||||
'- [@discordeno/utils](modules/Utils)',
|
||||
'',
|
||||
].join('\n')
|
||||
}
|
||||
|
||||
// Removes the old file in case it had ugly name, will be recreated below
|
||||
fs.rmSync(filepath)
|
||||
|
||||
// add all the words we need to replace here for invalid jsx errors
|
||||
const words = ['internal']
|
||||
for (const word of words) {
|
||||
file = file.replace(new RegExp(`<${word}>`, 'gi'), word)
|
||||
}
|
||||
|
||||
// Converts ugly names to clean names for example discordeno_types.ActionRow becomes ActionRow
|
||||
const cleanForms = [
|
||||
{ ugly: 'discordeno_bot.md', clean: 'Bot.md' },
|
||||
{ ugly: 'discordeno_gateway.md', clean: 'Gateway.md' },
|
||||
{ ugly: 'discordeno_rest.md', clean: 'Rest.md' },
|
||||
{ ugly: 'discordeno_types.md', clean: 'Types.md' },
|
||||
{ ugly: 'discordeno_utils.md', clean: 'Utils.md' },
|
||||
{ ugly: 'discordeno_bot.' },
|
||||
{ ugly: 'discordeno_gateway.' },
|
||||
{ ugly: 'discordeno_rest.' },
|
||||
{ ugly: 'discordeno_types.' },
|
||||
{ ugly: 'discordeno_utils.' },
|
||||
]
|
||||
|
||||
for (const form of cleanForms) {
|
||||
// Clean the file of the ugly forms
|
||||
file = file.replace(new RegExp(form.ugly, 'gi'), form.clean ?? '')
|
||||
// Clean the file name of the ugly forms
|
||||
if (!filepath.endsWith(`${form.ugly}md`)) filepath = filepath.replace(new RegExp(form.ugly, 'gi'), form.clean ?? '')
|
||||
}
|
||||
|
||||
file = file.replace(/(?<!\\)(<|>|,|=|\{|\})/gi, `\\$1`)
|
||||
file = file.replace(/(?<!README|modules)\.md/gi, '')
|
||||
|
||||
if (file.includes('Promise<')) console.log('Removing Promise< failed')
|
||||
|
||||
if (filepath.endsWith('/md')) {
|
||||
filepath = filepath.replace('/md', '/README.md')
|
||||
}
|
||||
|
||||
if (filepath.includes('/generated/modules/discordeno_')) {
|
||||
const mod = filepath.substring(filepath.lastIndexOf('_') + 1)
|
||||
filepath = filepath.substring(0, filepath.lastIndexOf('/')) + `/${mod[0].toUpperCase()}${mod.substring(1)}`
|
||||
}
|
||||
|
||||
fs.writeFileSync(filepath, file)
|
||||
}
|
||||
await writeFile(
|
||||
`${typedocOutPath}/README.md`,
|
||||
[
|
||||
'[**Documentation**](README.md) • **Docs**',
|
||||
'',
|
||||
'***',
|
||||
'',
|
||||
'# Discordeno',
|
||||
'',
|
||||
'Thank you for using Discordeno. These docs are generated automatically. If you see any issues please contact us on [Discord](https://discord.gg/ddeno)',
|
||||
'',
|
||||
].join('\n'),
|
||||
)
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
"$schema": "https://typedoc.org/schema.json",
|
||||
"entryPointStrategy": "packages",
|
||||
"entryPoints": ["packages/bot", "packages/gateway", "packages/rest", "packages/types", "packages/utils"],
|
||||
"out": "./website/api_reference/generated/",
|
||||
"out": "./website/api_reference/generated",
|
||||
"cleanOutputDir": false,
|
||||
"plugin": ["typedoc-plugin-markdown"],
|
||||
"commentStyle": "all"
|
||||
"commentStyle": "all",
|
||||
"sanitizeComments": true
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "Bot",
|
||||
"position": 1,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for the bot package."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "Gateway",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for the gateway package."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "REST",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for the rest package."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "Types",
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for the types package."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "Utils",
|
||||
"position": 5,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for the utils package."
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
discordeno-monorepo / [Modules](modules.md)
|
||||
[**Documentation**](README.md) • **Docs**
|
||||
|
||||
***
|
||||
|
||||
# Discordeno
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"label": "Classes",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for modules."
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"label": "Enums",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for enums."
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"label": "Interfaces",
|
||||
"position": 4,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for interfaces"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
[discordeno-monorepo](README.md) / Modules
|
||||
|
||||
# discordeno-monorepo
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Modules
|
||||
|
||||
- [@discordeno/bot](modules/Bot)
|
||||
- [@discordeno/gateway](modules/Gateway)
|
||||
- [@discordeno/rest](modules/Rest)
|
||||
- [@discordeno/types](modules/Types)
|
||||
- [@discordeno/utils](modules/Utils)
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"label": "Modules",
|
||||
"position": 5,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Automatically generated documentation for modules."
|
||||
}
|
||||
}
|
||||
@@ -174,20 +174,24 @@ const config: Config = {
|
||||
title: 'API Reference',
|
||||
items: [
|
||||
{
|
||||
label: 'Classes',
|
||||
to: '/api_reference/category/classes-3',
|
||||
label: 'Bot package',
|
||||
to: '/api_reference/category/bot-3',
|
||||
},
|
||||
{
|
||||
label: 'Enums',
|
||||
to: '/api_reference/category/enums-3',
|
||||
label: 'Gateway package',
|
||||
to: '/api_reference/category/gateway-3',
|
||||
},
|
||||
{
|
||||
label: 'Interfaces',
|
||||
to: '/api_reference/category/interfaces-3',
|
||||
label: 'Rest package',
|
||||
to: '/api_reference/category/rest-3',
|
||||
},
|
||||
{
|
||||
label: 'Modules',
|
||||
to: '/api_reference/category/modules-3',
|
||||
label: 'Utils package',
|
||||
to: '/api_reference/category/utils-3',
|
||||
},
|
||||
{
|
||||
label: 'Types package',
|
||||
to: '/api_reference/category/types-3',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -6763,9 +6763,9 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001449, caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001541":
|
||||
version: 1.0.30001566
|
||||
resolution: "caniuse-lite@npm:1.0.30001566"
|
||||
checksum: fdff43ed498201bf4f6074bd1112bd853e91973b6ccb016049b030948a7d197cba235ac4d93e712d1862b33a3c947bf4e62bad7011ccdac78e5179501b28d04a
|
||||
version: 1.0.30001641
|
||||
resolution: "caniuse-lite@npm:1.0.30001641"
|
||||
checksum: d60df2662fcae31efc8f36451929640e9630bb2e936f7449166dc70dcc4a757f6d86a5a089eed763b58354d684404b175e6c8790a9fd95c48abed1fcb7c26225
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
74
yarn.lock
74
yarn.lock
@@ -2073,8 +2073,8 @@ __metadata:
|
||||
lint-staged: "npm:^15.2.7"
|
||||
prettier: "npm:^3.2.5"
|
||||
turbo: "npm:^1.11.3"
|
||||
typedoc: "npm:^0.26.3"
|
||||
typedoc-plugin-markdown: "npm:3.17.1"
|
||||
typedoc: "npm:^0.26.4"
|
||||
typedoc-plugin-markdown: "npm:^4.1.2"
|
||||
typescript: "npm:^5.5.3"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -3187,24 +3187,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"handlebars@npm:^4.7.7":
|
||||
version: 4.7.7
|
||||
resolution: "handlebars@npm:4.7.7"
|
||||
dependencies:
|
||||
minimist: "npm:^1.2.5"
|
||||
neo-async: "npm:^2.6.0"
|
||||
source-map: "npm:^0.6.1"
|
||||
uglify-js: "npm:^3.1.4"
|
||||
wordwrap: "npm:^1.0.0"
|
||||
dependenciesMeta:
|
||||
uglify-js:
|
||||
optional: true
|
||||
bin:
|
||||
handlebars: bin/handlebars
|
||||
checksum: 617b1e689b7577734abc74564bdb8cdaddf8fd48ce72afdb489f426e9c60a7d6ee2a2707c023720c4059070128243c948bded8f2716e4543378033e3971b85ea
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2":
|
||||
version: 1.0.2
|
||||
resolution: "has-bigints@npm:1.0.2"
|
||||
@@ -4253,7 +4235,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6":
|
||||
"minimist@npm:^1.2.0, minimist@npm:^1.2.6":
|
||||
version: 1.2.8
|
||||
resolution: "minimist@npm:1.2.8"
|
||||
checksum: 908491b6cc15a6c440ba5b22780a0ba89b9810e1aea684e253e43c4e3b8d56ec1dcdd7ea96dde119c29df59c936cde16062159eae4225c691e19c70b432b6e6f
|
||||
@@ -4405,13 +4387,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"neo-async@npm:^2.6.0":
|
||||
version: 2.6.2
|
||||
resolution: "neo-async@npm:2.6.2"
|
||||
checksum: 1a7948fea86f2b33ec766bc899c88796a51ba76a4afc9026764aedc6e7cde692a09067031e4a1bf6db4f978ccd99e7f5b6c03fe47ad9865c3d4f99050d67e002
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"nice-napi@npm:^1.0.2":
|
||||
version: 1.0.2
|
||||
resolution: "nice-napi@npm:1.0.2"
|
||||
@@ -5422,13 +5397,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"source-map@npm:^0.6.1":
|
||||
version: 0.6.1
|
||||
resolution: "source-map@npm:0.6.1"
|
||||
checksum: 59ef7462f1c29d502b3057e822cdbdae0b0e565302c4dd1a95e11e793d8d9d62006cdc10e0fd99163ca33ff2071360cf50ee13f90440806e7ed57d81cba2f7ff
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"source-map@npm:^0.7.3":
|
||||
version: 0.7.4
|
||||
resolution: "source-map@npm:0.7.4"
|
||||
@@ -5937,20 +5905,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typedoc-plugin-markdown@npm:3.17.1":
|
||||
version: 3.17.1
|
||||
resolution: "typedoc-plugin-markdown@npm:3.17.1"
|
||||
dependencies:
|
||||
handlebars: "npm:^4.7.7"
|
||||
"typedoc-plugin-markdown@npm:^4.1.2":
|
||||
version: 4.1.2
|
||||
resolution: "typedoc-plugin-markdown@npm:4.1.2"
|
||||
peerDependencies:
|
||||
typedoc: ">=0.24.0"
|
||||
checksum: 21bfe7fba60e3c27e15700196b1b4abdf5b63bfdc9a4af57cf6f0891f9d359ac561435773709c6ea3555bae402b7a81b637d055e767afd33e2c0dc717d0449d2
|
||||
typedoc: 0.26.x
|
||||
checksum: 6e62150209aae7d55804fe5df83639ffe7625bd5bac80840a6650af40ed8c9b0e560d106a4b2912e167fc73762c3beaef5e154fa44457b7f67cf9fced90b5037
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typedoc@npm:^0.26.3":
|
||||
version: 0.26.3
|
||||
resolution: "typedoc@npm:0.26.3"
|
||||
"typedoc@npm:^0.26.4":
|
||||
version: 0.26.4
|
||||
resolution: "typedoc@npm:0.26.4"
|
||||
dependencies:
|
||||
lunr: "npm:^2.3.9"
|
||||
markdown-it: "npm:^14.1.0"
|
||||
@@ -5961,7 +5927,7 @@ __metadata:
|
||||
typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x
|
||||
bin:
|
||||
typedoc: bin/typedoc
|
||||
checksum: 55473079de55140d29299b449c0c8de6da1c6c76553bae17c11d1be9e4521612c5f0d9d5a6ee4e18ba7103f79de9ff98223fa0fb2d0e09b2bd535e54efe3d08d
|
||||
checksum: c25cce210c0ac0ac5328c11cc036344a6495bb49ed2191e580d1287edca2269ffe5e69dca5a75198174830e2d3c3bb560d70a6d22a24c0df293a069dd7d26318
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -5999,15 +5965,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uglify-js@npm:^3.1.4":
|
||||
version: 3.17.4
|
||||
resolution: "uglify-js@npm:3.17.4"
|
||||
bin:
|
||||
uglifyjs: bin/uglifyjs
|
||||
checksum: 4c0b800e0ff192079d2c3ce8414fd3b656a570028c7c79af5c29c53d5c532b68bbcae4ad47307f89c2ee124d11826fff7a136b59d5c5bb18422bcdf5568afe1e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"unbox-primitive@npm:^1.0.2":
|
||||
version: 1.0.2
|
||||
resolution: "unbox-primitive@npm:1.0.2"
|
||||
@@ -6150,13 +6107,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"wordwrap@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "wordwrap@npm:1.0.0"
|
||||
checksum: 497d40beb2bdb08e6d38754faa17ce20b0bf1306327f80cb777927edb23f461ee1f6bc659b3c3c93f26b08e1cf4b46acc5bae8fda1f0be3b5ab9a1a0211034cd
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"workerpool@npm:6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "workerpool@npm:6.2.1"
|
||||
|
||||
Reference in New Issue
Block a user