Skip to content

fileng87/lfcord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LFcord

A handler that can handle discord.js's command and event

Install

npm install lfcord
yarn add lfcord

Mode

You can choose mode when command register

'dev'  // regist all command in guild
'prod' // regist command in application if guildCommand is true it will regist the command in guild
'debug'// same as dev mode

Example

const { LFcord } = require('lfcord');
const { Client,	GatewayIntentBits, SlashCommandBuilder } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

const lfcord = new LFcord(client);

lfcord.addEvent({
	name: 'ready',
	execute: () => {
		console.log(`Logged in as ${client.user?.tag}!`);
	},
});

lfcord.addCommand({
  data: new SlashCommandBuilder()
		.setName('ping')
		.setDescription('Pong!'),
	guildCommand: true,
	execute: async ({ interaction, client }) => {
		interaction.reply('Pong!');
	},
});

lfcord.registCommands(
	YOUR_TOKEN,
	YOUR_GUILD_ID,
	YOUR_CLIENT_ID,
	THE_REGIST_MODE
);

About

A handler that can handle discord.js's command and event

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published