Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 1.74 KB

README.md

File metadata and controls

63 lines (51 loc) · 1.74 KB



About

@reciple/core contains the core components of Reciple such as the extended Discord.js Client and command builders.

Usage

// @ts-check
import { RecipleClient, SlashCommandBuilder } from '@reciple/core';

const client = new RecipleClient({
    token: 'YOUR_TOKEN',
    client: {
        intents: ['Guilds']
    }
});

await client.login();

client.commands?.add(
    new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with pong!')
        .setExecute(async ({ interaction }) => {
            await interaction.reply('Pong!');
        }),
)

await client.commands?.registerApplicationCommands();

client.on('interactionCreate', async interaction => {
    if (interaction.isChatInputCommand()) await client.commands?.execute(interaction);
});