-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblackjack.js
33 lines (29 loc) · 945 Bytes
/
blackjack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import {
SlashCommandBuilder,
InteractionContextType,
ApplicationIntegrationType,
CommandInteraction // eslint-disable-line no-unused-vars
} from 'discord.js';
import { Blackjack } from '@lib/games/blackjack.js';
// Include command when registering global application commands.
export const global = true;
// Create API-compatible JSON data for the command.
export const data = new SlashCommandBuilder()
.setName('blackjack')
.setDescription('Blackjack game')
.setContexts(InteractionContextType.Guild)
.setIntegrationTypes(
ApplicationIntegrationType.UserInstall,
ApplicationIntegrationType.GuildInstall
)
.addUserOption(opt => opt
.setName('p2')
.setDescription('Player #2')
);
/**
* Represents a slash command interaction.
* @param {CommandInteraction} interaction
*/
export async function execute(interaction) {
await new Blackjack(interaction).run();
}