@discordeno/bot 18.0.0-next.1381838

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # Discordeno
2
+
3
+ <img align="right" src="https://raw.githubusercontent.com/discordeno/discordeno/main/site/static/img/logo.png" height="150px">
4
+
5
+ Discord API library for [Deno](https://deno.land)
6
+
7
+ Discordeno follows [semantic versioning](https://semver.org/)
8
+
9
+ [![Discord](https://img.shields.io/discord/785384884197392384?color=7289da&logo=discord&logoColor=dark)](https://discord.com/invite/5vBgXk3UcZ)
10
+ ![Test](https://github.com/discordeno/discordeno/workflows/Test/badge.svg)
11
+ [![Coverage](https://img.shields.io/codecov/c/gh/discordeno/discordeno)](https://codecov.io/gh/discordeno/discordeno)
12
+
13
+ ## Features
14
+
15
+ Discordeno is actively maintained to guarantee **excellent performance and ease.**
16
+
17
+ - **Simple, Efficient, and Lightweight**: Discordeno is lightweight, simple to use, and adaptable. By default, no
18
+ caching.
19
+ - **Functional API**: The functional API eliminates the challenges of extending built-in classes and inheritance while
20
+ ensuring overall simple but performant code.
21
+ - **Cross Runtime**: Supports the Node.js and Deno runtimes.
22
+ - **Standalone components**: Discordeno offers the option to have practically any component of a bot as a separate
23
+ piece, including standalone REST, gateways, custom caches, and more.
24
+ - **Plugins:** Designed to allow you to overwrite any portion of the code with your own code. Never go through the
25
+ hassle of maintaining your fork in order to acquire something that is specifically tailored to your requirements.
26
+ Plugins may be used for nearly anything; for instance, we have a few authorised plugins.
27
+
28
+ - A caching plugin that makes anything cacheable.
29
+ - A plugin for sweepers that allows them to periodically clear the cache.
30
+ - The permission plugin internally verifies any missing permissions before sending a call to the Discord API to
31
+ prevent the client from receiving a Discord global ban.
32
+
33
+ - **Flexibility:** You may easily delete an object's attributes if your bot doesn't require them. For instance, you
34
+ 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
35
+ few lines of code are all that are needed to accomplish this for any property on any object.
36
+
37
+ ### REST
38
+
39
+ - Freedom from 1 hour downtimes due to invalid requests
40
+ - By lowering the maximum downtime to 10 minutes, Discordeno will prevent your bot from being down for an hour.
41
+ - Freedom from global rate limit errors
42
+ - As your bot grows, you want to handle global rate limits better. Shards don't communicate fast enough to truly
43
+ handle it properly so this allows 1 rest handler across the entire bot.
44
+ - You may really run numerous instances of your bot on different hosts, all of which will connect to the same REST
45
+ server.
46
+ - REST does not rest!
47
+ - Separate rest guarantees that your queued requests will continue to be processed even if your bot breaks for
48
+ whatever reason.
49
+ - Seamless updates! There's a chance you'll lose a lot of messages or replies that are waiting to be given when you
50
+ wish to update and restart the bot. You may restart your bot using this technique and never have to worry about
51
+ losing any answers.
52
+ - Single source of contact to Discord API
53
+ - As a result, you will be able to send requests to Discord from any location, even a bot dashboard. You are no longer
54
+ need to interact with your bot processes in order to submit a request or do anything else. Your bot process should
55
+ be freed up to handle bot events.
56
+ - Scalability! Scalability! Scalability!
57
+
58
+ ### Gateway
59
+
60
+ - **Zero Downtime Updates:**
61
+ - A few seconds are needed to update your bot. When using conventional sharding, you must restart in addition to going
62
+ through a 1/5s rate-limited process of identifying all of your shards. As WS processing has been relocated to a
63
+ proxy process, you may resume the bot code right away without worrying about any delays. Normally, if you had a bot
64
+ that was spread across 200,000 servers, restarting it after making a simple modification would take 20 minutes.
65
+ - **Zero Downtime Resharding:**
66
+ - At various periods in time, Discord stops allowing your bot to be added to new servers. Consider 150 shards
67
+ operating on 150,000 servers, for instance. Your shards may support a maximum of 150 \* 2500 = 375,000 servers. Your
68
+ bot will be unable to join new servers once it reaches this point until it re-shards.
69
+ - DD proxy provides 2 types of re-sharding. Automated and manual. You can also have both.
70
+ - Automated: This system will automatically begin a Zero-downtime resharding process behind the scenes when you
71
+ reach 80% of your maximum servers allowed by your shards. For example, since 375,000 was the max, at 300,000 we
72
+ would begin re-sharding behind the scenes with ZERO DOWNTIME.
73
+ - 80% of maximum servers reached (The % of 80% is customizable.)
74
+ - Identify limits have room to allow re-sharding. (Also customizable)
75
+ - Manual: You can also trigger this manually should you choose.
76
+ - **Horizontal Scaling:**
77
+ - The bot may be scaled horizontally thanks to the proxy mechanism. When your business grows significantly, you have
78
+ two options: you can either keep investing money to upgrade your server or you may expand horizontally by purchasing
79
+ numerous more affordable servers. The proxy enables WS handling on a totally other system.
80
+ - **No Loss Restarts:**
81
+ - Without the proxy mechanism, you would typically lose numerous events while restarting a bot. Users could issue
82
+ instructions or send messages that are not screened. As your bot population increases, this amount grows sharply.
83
+ Users who don't receive the automatic roles or any other activities your bot should do may join. You may keep
84
+ restarting your bot thanks to the proxy technology without ever losing any events. While your bot is unavailable,
85
+ events will be added to a queue (the maximum size of the queue is configurable), and once the bot is back online,
86
+ the queue will start processing all of the events.
87
+ - **Controllers:**
88
+ - You have complete control over everything inside the proxy thanks to the controller aspect. To simply override the
89
+ handler, you may supply a function. For instance, you may simply give a method to override a specific function if
90
+ you want it to behave differently rather than forking and maintaining your fork.
91
+ - **Clustering With Workers:**
92
+ - Utilize all of your CPU cores to their greatest potential by distributing the workload across employees. To enhance
93
+ efficiency, manage how many employees and shards there are each worker!
94
+
95
+ ### Custom Cache
96
+
97
+ Have your cache setup in any way you like. Redis, PGSQL or any cache layer you would like.
98
+
99
+ ## Getting Started
100
+
101
+ ### Minimal Example
102
+
103
+ Here is a minimal example to get started with:
104
+
105
+ ```typescript
106
+ import {
107
+ createBot,
108
+ Intents,
109
+ startBot,
110
+ } from "https://deno.land/x/discordeno@13.0.0/mod.ts";
111
+
112
+ const bot = createBot({
113
+ token: process.env.DISCORD_TOKEN,
114
+ intents: Intents.Guilds | Intents.GuildMessages,
115
+ events: {
116
+ ready() {
117
+ console.log("Successfully connected to gateway");
118
+ },
119
+ },
120
+ });
121
+
122
+ // Another way to do events
123
+ bot.events.messageCreate = function (b, message) {
124
+ // Process the message here with your command handler.
125
+ };
126
+
127
+ await startBot(bot);
128
+ ```
129
+
130
+ ### Tools
131
+
132
+ This library is not intended for beginners, however if you still want to utilise it, check out these excellent official
133
+ and unofficial templates:
134
+
135
+ **Templates**
136
+
137
+ - [Discordeno Template (official)](https://github.com/discordeno/discordeno/tree/main/template)
138
+ - [Serverless Slash Commands Template (official)](https://github.com/discordeno/serverless-deno-deploy-template)
139
+ - [`create-discordeno-bot` (WIP, unoffical)](https://github.com/Reboot-Codes/create-discordeno-bot/)
140
+ - [Add Your Own!](https://github.com/discordeno/discordeno/pulls)
141
+
142
+ **Frameworks**
143
+
144
+ - [Amethyst Framework](https://github.com/AmethystFramework/framework)
145
+ - [Add Your Own!](https://github.com/discordeno/discordeno/pulls)
146
+
147
+ **Plugins**
148
+
149
+ - [Cache Plugin](plugins/cache)
150
+ - [Fileloader Plugin](plugins/fileloader)
151
+ - [Helpers Plugin](plugins/helpers)
152
+ - [Permissions Plugin](plugins/permissions)
153
+
154
+ ## Links
155
+
156
+ - [Website](https://discordeno.mod.land)
157
+ - [Documentation](https://doc.deno.land/https/deno.land/x/discordeno/mod.ts)
158
+ - [Discord](https://discord.com/invite/5vBgXk3UcZ)