@itsmapleleaf/gatekeeper

v0.1.0
a slash command and interaction framework for discord.js
discord discord.js slash command commands interaction message component framework and 5 more...

gatekeeper

Gatekeeper is a ✨reactive✨ interaction framework for discord.js!

Install:

# npm
npm install @itsmapleleaf/gatekeeper discord.js

# yarn
yarn add @itsmapleleaf/gatekeeper discord.js

# pnpm
pnpm add @itsmapleleaf/gatekeeper discord.js

Here's a taste of what Gatekeeper looks like:

import { buttonComponent, Gatekeeper } from "@itsmapleleaf/gatekeeper"
import { Client, Intents } from "discord.js"

const client = new Client({
  intents: [Intents.FLAGS.GUILDS],
})

;(async () => {
  const gatekeeper = await Gatekeeper.create({
    client,
  })

  gatekeeper.addSlashCommand({
    name: "counter",
    description: "make a counter",
    run(context) {
      let count = 0

      context.reply(() => [
        `button pressed ${count} times`,
        buttonComponent({
          style: "PRIMARY",
          label: "press it",
          onClick: () => {
            count += 1
          },
        }),
      ])
    },
  })

  await client.login(process.env.BOT_TOKEN)
})()

And a silly example, demonstrating the power of the library. You can find the code here

showcase

npm i @itsmapleleaf/[email protected]

Metadata

  • Unknown
  • Whatever
  • itsmapleleaf
  • released 8/23/2021

Downloads

Maintainers