@hawkdotjs/typings
v1.5.5
Published
Bot typings with typescript.
Downloads
6
Readme
About
@hawkdotjs/typings Is An Advanced DJS Bot Typings with TypeScript.
Installation
Note: Node.js 19.0.0 or newer is required.
npm install @hawkdotjs/typings
Example Usage
CommonJS
const { CommandBuilder, EventBuilder } = require("@hawkdotjs/typings");
// Command
const HelloWorldCommand = new CommandBuilder()
.setScope("Global")
.setCategory("Fun")
.setData(
data => data
.setName("helloworld")
.setDescription('Replies with "Hello World!"')
)
.onExecute(async interaction => {
await interaction.reply("Hello World!")
});
// Event
const ReadyEvent = new EventBuilder()
.setName("ready")
.onExecute(() => {
return console.log("Bot is online.")
});
ESM Module
import { CommandBuilder, EventBuilder } from "@hawkdotjs/typings";
// Command
const HelloWorldCommand = new CommandBuilder()
.setScope("Global")
.setCategory("Fun")
.setData(
data => data
.setName("helloworld")
.setDescription('Replies with "Hello World!"')
)
.onExecute(async interaction => {
await interaction.reply("Hello World!")
});
// Event
const ReadyEvent = new EventBuilder()
.setName("ready")
.onExecute(() => {
return console.log("Bot is online.")
});