npm.io
1.5.5 • Published 3 years ago

@hawkdotjs/typings

Licence
MIT
Version
1.5.5
Deps
1
Size
12 kB
Vulns
0
Weekly
0
pack icon

Hawk JS/Typings

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.")
  });
github profile npm profile