disgroove 2.0.0-dev.40377cb → 2.0.0
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 +9 -9
- package/dist/lib/Client.d.ts +560 -142
- package/dist/lib/Client.js +1794 -124
- package/dist/lib/Client.js.map +1 -1
- package/dist/lib/constants.d.ts +7 -7
- package/dist/lib/constants.js +218 -218
- package/dist/lib/gateway/Shard.d.ts +0 -1
- package/dist/lib/gateway/Shard.js +65 -261
- package/dist/lib/gateway/Shard.js.map +1 -1
- package/dist/lib/gateway/ShardManager.d.ts +1 -2
- package/dist/lib/gateway/ShardManager.js +1 -2
- package/dist/lib/gateway/ShardManager.js.map +1 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/rest/Endpoints.d.ts +3 -3
- package/dist/lib/rest/Endpoints.js +8 -8
- package/dist/lib/rest/Endpoints.js.map +1 -1
- package/dist/lib/rest/RequestManager.d.ts +8 -2
- package/dist/lib/rest/RequestManager.js +17 -10
- package/dist/lib/rest/RequestManager.js.map +1 -1
- package/dist/lib/rest/index.d.ts +0 -1
- package/dist/lib/rest/index.js +0 -1
- package/dist/lib/rest/index.js.map +1 -1
- package/dist/lib/structures/Webhook.js +14 -3
- package/dist/lib/structures/Webhook.js.map +1 -1
- package/dist/lib/types/application-command.d.ts +94 -20
- package/dist/lib/types/application-role-connection-metadata.d.ts +7 -6
- package/dist/lib/types/application.d.ts +24 -13
- package/dist/lib/types/audit-log.d.ts +15 -16
- package/dist/lib/types/auto-moderation.d.ts +27 -7
- package/dist/lib/types/channel.d.ts +170 -68
- package/dist/lib/types/emoji.d.ts +12 -3
- package/dist/lib/types/entitlements.d.ts +6 -1
- package/dist/lib/types/gateway-events.d.ts +11 -336
- package/dist/lib/types/guild-scheduled-event.d.ts +31 -8
- package/dist/lib/types/guild-template.d.ts +16 -4
- package/dist/lib/types/guild.d.ts +190 -37
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/interaction.d.ts +37 -36
- package/dist/lib/types/invite.d.ts +12 -12
- package/dist/lib/types/message-components.d.ts +12 -12
- package/dist/lib/types/role.d.ts +3 -3
- package/dist/lib/types/sku.d.ts +8 -8
- package/dist/lib/types/stage-instance.d.ts +12 -1
- package/dist/lib/types/sticker.d.ts +18 -6
- package/dist/lib/types/team.d.ts +5 -5
- package/dist/lib/types/user.d.ts +30 -7
- package/dist/lib/types/voice.d.ts +4 -4
- package/dist/lib/types/webhook.d.ts +38 -6
- package/dist/lib/utils/Util.d.ts +2 -13
- package/dist/lib/utils/Util.js +39 -535
- package/dist/lib/utils/Util.js.map +1 -1
- package/dist/lib/utils/errors.d.ts +1 -1
- package/dist/lib/utils/errors.js +4 -4
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/package.json +7 -7
- package/package.json +7 -7
package/README.md
CHANGED
@@ -5,7 +5,7 @@ A module to interface with Discord
|
|
5
5
|
## Features
|
6
6
|
|
7
7
|
- No cache: For large bots the cache might be a RAM memory management issue, this module doesn't include it
|
8
|
-
- Very
|
8
|
+
- Very fast: The module contains all methods in the Client class, so sending API requests will not have to go through a third party, and this allows the module to be faster
|
9
9
|
- Documentation-based: The module is based entirely on the [Official Discord API Documentation](https://discord.com/developers/docs/intro), so it does not add custom methods or properties, to avoid future problems
|
10
10
|
|
11
11
|
## Installation
|
@@ -34,27 +34,27 @@ const client = new Client("token", {
|
|
34
34
|
});
|
35
35
|
|
36
36
|
client.on("ready", async () => {
|
37
|
-
console.log(`${client.user.username} is now online!`); //
|
37
|
+
console.log(`${client.user.username} is now online!`); // Prints "Username is now online!" when the bot connects to the gateway
|
38
38
|
|
39
|
-
client.application.
|
39
|
+
client.createGlobalApplicationCommand(client.application.id, {
|
40
40
|
name: "ping",
|
41
41
|
description: "Responds with Pong! 🏓",
|
42
|
-
}); //
|
42
|
+
}); // Creates a global application command named "ping"
|
43
43
|
|
44
44
|
client.setPresence({
|
45
45
|
activity: {
|
46
46
|
name: "/ping",
|
47
47
|
type: ActivityType.Watching,
|
48
48
|
},
|
49
|
-
}); //
|
49
|
+
}); // Updates the bot presence to "Watching /ping"
|
50
50
|
});
|
51
51
|
|
52
52
|
client.on("interactionCreate", async (interaction) => {
|
53
|
-
if (interaction.type !== InteractionType.ApplicationCommand) return; //
|
53
|
+
if (interaction.type !== InteractionType.ApplicationCommand) return; // Checks if the interaction is an application command
|
54
54
|
|
55
55
|
if (interaction.data.name === "ping") {
|
56
|
-
//
|
57
|
-
interaction.
|
56
|
+
// Checks if the application command name is equals to "ping"
|
57
|
+
client.createInteractionResponse(interaction.id, interaction.token, {
|
58
58
|
type: InteractionCallbackType.ChannelMessageWithSource,
|
59
59
|
data: {
|
60
60
|
content: "Pong! 🏓",
|
@@ -64,7 +64,7 @@ client.on("interactionCreate", async (interaction) => {
|
|
64
64
|
}
|
65
65
|
});
|
66
66
|
|
67
|
-
client.connect(); //
|
67
|
+
client.connect(); // Connects the bot to the gateway
|
68
68
|
```
|
69
69
|
|
70
70
|
Enjoy the package? Give it a ⭐ on [GitHub repository](https://github.com/XenKys/disgroove)
|