1.1.8 • Published 2 years ago

lvhandler v1.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

GitHub Repo

LVHandler

LVHandler is a discord command/event handler. It is very easy to use and makes it easy to create commands and events. It also automatically integrates the files in the command/event folder you specify into your bot. You can better understand what I have explained with the following examples.

Example Usage

Install NPM Package:

npm install lvhandler

Setup LVHandler:

index.ts

import { Client, Events, IntentsBitField } from "discord.js";
import LVHandler from "lvhandler";
import path from "path";

const client = new Client({ intents: / Your Intents / })

client.on(Events.ClientReady, () => { new LVHandler({ client: client, // Your client instance commandDir: path.join(dirname, "Commands"), // Bots command dir. eventDir: path.join(dirname, "Events"), // Bots event dir. autoDelete: true, // Auto delete slash command when file not exists. defaultPrefix: "!" // Default prefix for non-slash (regular) commands. }) })

client.login("TOKEN")

**Command Creation:**
> _Commands/ping.ts_
```ts
import { LVCommand } from "lvhandler";
import { TypeOfCommand } from "lvhandler";

export default {
    description: "Replies With Pong.", // Command Description.
    type: TypeOfCommand.SLASH, // Command Type. (BOTH, SLASH, REGULAR)
    options: [], // Command Options.

    execute: async ({ interaction }) => {
        if (!interaction) return
        await interaction.reply({ content: "Pong!" })
    }
} as LVCommand

Event Creation:

Events/replyToHi.ts

import { Events } from "discord.js";
import { LVEvent } from "lvhandler";

export default { execute: (client) => { client.on(Events.MessageCreate, async (message) => { if (message.content.toLowerCase() === "hi") { await message.reply("Hi!") } }) } } as LVEvent

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.7.7

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago