@itsmapleleaf/gatekeeper
v0.0.0-alpha.4 discord discord.js slash command commands interaction message component framework and 2 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
npm i @itsmapleleaf/[email protected]
Metadata
- Unknown
- Whatever
- Unknown
- released 8/15/2021