use adapter to make discord.js optional
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Client } from "discord.js"
|
||||
import "dotenv/config"
|
||||
import React from "react"
|
||||
import { DiscordJsAdapter } from "../src/discord-js-adapter"
|
||||
import { Reacord } from "../src/main.js"
|
||||
import { createCommandHandler } from "./command-handler.js"
|
||||
import { Counter } from "./counter.js"
|
||||
@@ -9,14 +10,17 @@ const client = new Client({
|
||||
intents: ["GUILDS"],
|
||||
})
|
||||
|
||||
const reacord = Reacord.create({ client, maxInstances: 2 })
|
||||
const reacord = new Reacord({
|
||||
adapter: new DiscordJsAdapter(client),
|
||||
maxInstances: 2,
|
||||
})
|
||||
|
||||
createCommandHandler(client, [
|
||||
{
|
||||
name: "counter",
|
||||
description: "shows a counter button",
|
||||
run: (interaction) => {
|
||||
const reply = reacord.reply(interaction)
|
||||
const reply = reacord.createCommandReply(interaction)
|
||||
reply.render(<Counter onDeactivate={() => reply.deactivate()} />)
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user