@discordjs/core 0.3.1-dev.1678320636-4367ab9.0 → 0.3.1-dev.1678407048-1b29099.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 +2 -2
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ pnpm add @discordjs/core
|
|
|
35
35
|
```ts
|
|
36
36
|
import { REST } from '@discordjs/rest';
|
|
37
37
|
import { WebSocketManager } from '@discordjs/ws';
|
|
38
|
-
import { GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';
|
|
38
|
+
import { GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';
|
|
39
39
|
|
|
40
40
|
// Create REST and WebSocket managers directly
|
|
41
41
|
const rest = new REST({ version: '10' }).setToken(token);
|
|
@@ -51,7 +51,7 @@ const client = new Client({ rest, ws });
|
|
|
51
51
|
// Listen for interactions
|
|
52
52
|
// Each event contains an `api` prop along with the event data that allows you to interface with the Discord REST API
|
|
53
53
|
client.on(GatewayDispatchEvents.InteractionCreate, async ({ data: interaction, api }) => {
|
|
54
|
-
if (
|
|
54
|
+
if (interaction.type !== InteractionType.ApplicationCommand || interaction.data.name !== 'ping') {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
|
package/dist/index.js
CHANGED
|
@@ -1383,6 +1383,7 @@ var InteractionsAPI = class {
|
|
|
1383
1383
|
async reply(interactionId, interactionToken, { files, ...data }) {
|
|
1384
1384
|
await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1385
1385
|
files,
|
|
1386
|
+
auth: false,
|
|
1386
1387
|
body: {
|
|
1387
1388
|
type: import_v104.InteractionResponseType.ChannelMessageWithSource,
|
|
1388
1389
|
data
|
|
@@ -1398,6 +1399,7 @@ var InteractionsAPI = class {
|
|
|
1398
1399
|
*/
|
|
1399
1400
|
async defer(interactionId, interactionToken) {
|
|
1400
1401
|
await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1402
|
+
auth: false,
|
|
1401
1403
|
body: {
|
|
1402
1404
|
type: import_v104.InteractionResponseType.DeferredChannelMessageWithSource
|
|
1403
1405
|
}
|
|
@@ -1412,6 +1414,7 @@ var InteractionsAPI = class {
|
|
|
1412
1414
|
*/
|
|
1413
1415
|
async deferMessageUpdate(interactionId, interactionToken) {
|
|
1414
1416
|
await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1417
|
+
auth: false,
|
|
1415
1418
|
body: {
|
|
1416
1419
|
type: import_v104.InteractionResponseType.DeferredMessageUpdate
|
|
1417
1420
|
}
|
|
@@ -1474,6 +1477,7 @@ var InteractionsAPI = class {
|
|
|
1474
1477
|
async updateMessage(interactionId, interactionToken, { files, ...data }) {
|
|
1475
1478
|
await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1476
1479
|
files,
|
|
1480
|
+
auth: false,
|
|
1477
1481
|
body: {
|
|
1478
1482
|
type: import_v104.InteractionResponseType.UpdateMessage,
|
|
1479
1483
|
data
|
|
@@ -1490,6 +1494,7 @@ var InteractionsAPI = class {
|
|
|
1490
1494
|
*/
|
|
1491
1495
|
async createAutocompleteResponse(interactionId, interactionToken, data) {
|
|
1492
1496
|
await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1497
|
+
auth: false,
|
|
1493
1498
|
body: {
|
|
1494
1499
|
type: import_v104.InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
1495
1500
|
data
|
|
@@ -1506,6 +1511,7 @@ var InteractionsAPI = class {
|
|
|
1506
1511
|
*/
|
|
1507
1512
|
async createModal(interactionId, interactionToken, data) {
|
|
1508
1513
|
await this.rest.post(import_v104.Routes.interactionCallback(interactionId, interactionToken), {
|
|
1514
|
+
auth: false,
|
|
1509
1515
|
body: {
|
|
1510
1516
|
type: import_v104.InteractionResponseType.Modal,
|
|
1511
1517
|
data
|