Skip to content

Commit 7300b89

Browse files
authored
Merge pull request #22 from Vendicated/main
Implement latest api changes
2 parents b31059b + 88d0075 commit 7300b89

7 files changed

+18
-9
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "slash-commands",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/MeguminSama/discord-slash-commands"

Diff for: src/structures/Interaction.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { GuildMember } from "./GuildMember";
33
import { InteractionType } from "./InteractionType";
44
import { Snowflake } from "./Snowflake";
55

6-
type ApplicationCommand = {
6+
export type ApplicationCommandInteraction = {
77
id: Snowflake;
88
type: InteractionType.APPLICATION_COMMAND;
99
data: ApplicationCommandInteractionData;
@@ -13,7 +13,7 @@ type ApplicationCommand = {
1313
token: string;
1414
};
1515

16-
export type Interaction = ApplicationCommand | {
16+
export type Interaction = ApplicationCommandInteraction | {
1717
id: Snowflake;
1818
type: Exclude<InteractionType, InteractionType.APPLICATION_COMMAND>;
1919
data?: ApplicationCommandInteractionData;

Diff for: src/structures/InteractionResponseType.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export enum InteractionResponseType {
2+
/** ACK a ping */
23
PONG = 1,
3-
ACKNOWLEDGE = 2,
4-
CHANNEL_MESSAGE = 3,
4+
/** Respond immediately */
55
CHANNEL_MESSAGE_WITH_SOURCE = 4,
6-
ACK_WITH_SOURCE = 5,
6+
/** ACK interaction and respond later */
7+
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5,
78
}

Diff for: src/structures/MessageFlags.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
// JSDoc comments taken from https://discord.com/developers/docs/resources/channel#message-object-message-flags
2+
13
export enum MessageFlags {
4+
/** This message has been published to subscribed channels (via Channel Following) */
25
CROSSPOSTED = 1 << 0,
6+
/** This message originated from a message in another channel (via Channel Following) */
37
IS_CROSSPOST = 1 << 1,
8+
/** Do not include any embeds when serializing this message */
49
SUPPRESS_EMBEDS = 1 << 2,
10+
/** The source message for this crosspost has been deleted (via Channel Following) */
511
SOURCE_MESSAGE_DELETED = 1 << 3,
12+
/** This message came from the urgent message system */
613
URGENT = 1 << 4,
14+
/** This message is only visible to the user who ran the command, similar to clyde */
715
EPHEMERAL = 1 << 6,
816
}

Diff for: tests/commandBuilder.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {
44
ApplicationCommandOptionType,
55
SubcommandBuilder,
66
SubcommandGroupBuilder
7-
} = require('../dist')
7+
} = require('..')
88

99
describe('Create Commands with CommandBuilders', () => {
1010
test('CommandBuilder returns Object', () => {

Diff for: tests/createDeleteApplicationCommand.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require('dotenv').config()
2-
const { DiscordInteractions, ApplicationCommandOptionType } = require('../dist')
2+
const { DiscordInteractions, ApplicationCommandOptionType } = require('..')
33

44
const discord = new DiscordInteractions({
55
applicationId: process.env.TESTS_APPID,

Diff for: tests/createDeleteGuildCommand.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require('dotenv').config()
2-
const { DiscordInteractions, ApplicationCommandOptionType } = require('../dist')
2+
const { DiscordInteractions, ApplicationCommandOptionType } = require('..')
33

44
const discord = new DiscordInteractions({
55
applicationId: process.env.TESTS_APPID,

0 commit comments

Comments
 (0)