You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Disgo**is a [Discord API](https://discord.com/developers/docs/reference) Wrapper designed to be flexible, performant, secure, and thread-safe. Disgo aims to provide every feature in the Discord API along with optional rate limiting, structured logging, shard management, and caching. Use the only Go module to provide a **100% one-to-one implementation** of the Discord API.
6
+
**Disgo**helps you create a Discord Bot using the Go programming language.
7
7
8
-
_This repository is STABLE. For more information, read the [roadmap](/_contribution/CONTRIBUTING.md#roadmap)._
8
+
## What is Disgo?
9
9
10
-
## A Next Generation Discord API Wrapper
10
+
**Disgo** is a [Discord API](https://discord.com/developers/docs/reference) Wrapper designed to be flexible, performant, secure, and thread-safe. Disgo provides every feature in the Discord API along with optional rate limiting, structured logging, shard management, and caching.
11
11
12
-
High-quality code merits easy development.
12
+
_This repository is STABLE. For more information, read the [roadmap](/_contribution/CONTRIBUTING.md#roadmap)._
13
13
14
-
Disgo uses developer operations to stay up-to-date with the ever-changing Discord API.
15
-
- Code generation provides a clean implementation for every request and event.
16
-
- Data race detection is run on an integration test _that covers the entire Discord API_ to ensure that Disgo is safe for concurrent usage.
14
+
### A Next Generation Discord API Wrapper
17
15
18
-
In addition, **Disgo provides the following exclusive features**.
16
+
Use the only Go module to provide a **100% one-to-one horizontally scalable implementation** of the Discord API.
17
+
18
+
Your development is also simplified with these exclusive features.
19
19
20
20
-[EVERY Rate Limit (Global, Per Route, Per Resource, Custom, Gateway)](_contribution/concepts/REQUESTS.md#what-is-a-rate-limit)
@@ -44,13 +50,17 @@ This breakdown provides you with a **full understanding** on how to use the API.
44
50
|**Request**| Uses the Discord HTTP REST API to make one-time _requests_ for information. | Create an application command. <br> Request guild information. |
45
51
|**Session**| Uses a Discord WebSocket Connection [(Gateway)](https://discord.com/developers/docs/topics/gateway) to receive _events_ that contain information. | Send a message when an application command is used or a user joins a voice channel. |
46
52
47
-
You create a **Client** that calls for **Resources** using **Requests** and handles **Events** from **Sessions** using event handlers.
53
+
Here is an example.
54
+
55
+
You create a **Client** that **Requests****Resources** and handles **Events** from **Sessions** using Event Handlers.
48
56
49
57
_For more information, please read [What is a Request?](/_contribution/concepts/REQUESTS.md) and [What is an Event?](/_contribution/concepts/EVENTS.md)._
50
58
51
59
### Flags
52
60
53
-
A flag is a [flag](https://discord.com/developers/docs/resources/application#application-object-application-flags), [type](https://discord.com/developers/docs/resources/channel#embed-object-embed-types), [key](https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key), [level](https://discord.com/developers/docs/resources/guild#guild-object-verification-level) or any other option that Discord provides. All flags are denoted by `disgo.Flag`_(e.g., `disgo.FlagUserSTAFF`, `disgo.FlagVerificationLevelHIGH`, `disgo.FlagPremiumTierNONE`)_.
61
+
All flags are denoted by `disgo.Flag`_(e.g., `disgo.FlagUserSTAFF`, `disgo.FlagVerificationLevelHIGH`, `disgo.FlagPremiumTierNONE`)_.
62
+
63
+
A flag is a [flag](https://discord.com/developers/docs/resources/application#application-object-application-flags), [type](https://discord.com/developers/docs/resources/channel#embed-object-embed-types), [key](https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key), [level](https://discord.com/developers/docs/resources/guild#guild-object-verification-level) or any other option that Discord provides.
54
64
55
65
### Logging
56
66
@@ -68,7 +78,7 @@ _Read [What is a Discord Shard](/_contribution/concepts/SHARD.md) for a simple y
68
78
69
79
The [Disgo Cache](/_contribution/concepts/CACHE.md#the-disgo-cache) is **optional** and **customizable**.
70
80
71
-
The **cache interface**allows you to replace the built-in cache with another store _(such as Redis or Memcached)_ or provide your own caching implementation.
81
+
The **cache interface**lets you replace the built-in cache with another store _(such as Redis or Memcached)_ or provide your own caching implementation.
72
82
73
83
_Read [What is a Cache](/_contribution/concepts/CACHE.md) for a simple yet full understanding of the Disgo Cache._
74
84
@@ -106,6 +116,7 @@ bot := &disgo.Client{
106
116
Authorization: &disgo.Authorization{ ... },
107
117
Config: disgo.DefaultConfig(),
108
118
Handlers: new(disgo.Handlers),
119
+
VoiceHandlers: new(disgo.VoiceHandlers),
109
120
Sessions: disgo.NewSessionManager()
110
121
}
111
122
```
@@ -157,7 +168,7 @@ s := disgo.NewSession()
157
168
iferr:= s.Connect(bot); err != nil {
158
169
log.Printf("can't open websocket session to Discord Gateway: %v", err)
Go is a statically typed, compiled programming language _(with a garbage collector)_. So it performs computationally better compared to _most_ languages that provide [Discord API Wrappers](https://discord.com/developers/docs/topics/community-resources#libraries).
221
+
**A Discord Bot is server-side software.**
210
222
211
-
Go maintains superior asynchronous handling due to the use of [Goroutines](https://gobyexample.com/goroutines) and [Channels](https://gobyexample.com/channels): This is helpful since **a Discord Bot is server-side software**.
223
+
A server-side software uses asynchronous logic to operate.
224
+
Go maintains superior asynchronous handling with [Goroutines](https://gobyexample.com/goroutines) and [Channels](https://gobyexample.com/channels).
212
225
213
-
### Comparison
226
+
Go is a statically typed, compiled programming language _(with a garbage collector)_. So, it also performs better computationally compared to _most_ languages that provide [Discord API Wrappers](https://discord.com/developers/docs/topics/community-resources#libraries).
214
227
215
-
Disgo supports every feature in the Discord API and is **the most customizable Discord API Wrapper** due to its optional caching, shard management, rate limiting, and logging.
216
-
-**DiscordGo** is not feature-complete.
217
-
-**Disgord** is limiting.
228
+
### How does Disgo compare to other Go Discord API Wrappers?
218
229
219
-
Look no further than the name. The word `disgo` contains 5 letters — while the others have 7+ — saving you precious keyboard strokes.
230
+
Disgo supports every feature in the Discord API and is **the most customizable Discord API Wrapper** due to its optional caching, shard management, rate limiting, and logging.
220
231
221
232
Most important is Disgo's performance, which saves you money by reducing server costs.
222
233
@@ -256,7 +267,7 @@ The [Apache License 2.0](#license) is permissive for commercial use. For more in
Copy file name to clipboardExpand all lines: _contribution/CONTRIBUTING.md
+10-3
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Comments follow [Effective Go](https://golang.org/doc/effective_go#commentary) a
52
52
53
53
#### Static Code Analysis
54
54
55
-
Disgo uses [golangci-lint](https://github.com/golangci/golangci-lint) in order to statically analyze code. You can install golangci-lint with `go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3`.
55
+
Disgo uses [golangci-lint](https://github.com/golangci/golangci-lint) in order to statically analyze code. You can install golangci-lint with `go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5`.
Copy file name to clipboardExpand all lines: _contribution/concepts/CACHE.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ A [cache (computing)](https://en.wikipedia.org/wiki/Cache_(computing)) is a comp
4
4
5
5
## Why Cache?
6
6
7
-
A cache is an alternative to sending redundant requests — that take time to complete — to Discord: A cache stores data so that future requests for that data can be served immediately.
7
+
A cache stores data so that future requests for that data can be served immediately. A cache is an alternative to sending redundant requests — which take time to complete — to Discord.
8
8
9
9
For example, retrieving _the amount of users in a guild_ requires a network request to be sent to Discord, and another network request to be returned from Discord. Without a cache, retrieving _the exact same information_ again requires two more network requests, even when the guild's condition remains unchanged.
10
10
11
11
## When to Use a Cache?
12
12
13
-
Caches are useful for storing costly requests or calculations relevant to the application's lifetime. In other words, a cache is**NOT**meant to be used for long-term storage.
13
+
Use a cache to stop wasting time executing costly requests and calculations relevant to the application's lifetime. An application cache should**NOT** used for long-term storage because the cache resets when the application restarts.
14
14
15
-
**If you need data to persist when your bot restarts, use a database.**
15
+
**Use a database when you need data to persist when your bot restarts.**
16
16
17
17
## How Does a Cache Work?
18
18
@@ -29,4 +29,6 @@ _For more information, read [Cache Invalidation](https://en.wikipedia.org/wiki/C
29
29
30
30
## How Do I Cache?
31
31
32
-
Disgo provides an **optional** cache along with a **cache interface** for your Discord Bot. Read [The Disgo Cache](/cache/README.md) for information about its implementation.
32
+
Disgo provides an **optional** cache along with a **cache interface** for your Discord Bot.
33
+
34
+
Read [The Disgo Cache](/cache/README.md) for information about its implementation.
0 commit comments