Skip to content

Latest commit

 

History

History

core

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 



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);
});