@discordhttps/nodejs-adapter is an adapter for integrating discord.https with Nodejs Runtime.
npm install @discordhttps/nodejs-adapter discord.https
import Client from "discord.https";
import NodeAdapter from "@discordhttps/nodejs-adapter";
const adapter = new NodeAdapter();
import UtilityRoute from "./command/utility/index.js";
import HelloRoute from "./command/fun/hello.js";
const client = new Client({
token: process.env.TOKEN,
publicKey: process.env.PUBLIC_KEY,
httpAdapter: adapter,
debug: true,
});
client.register(UtilityRoute, HelloRoute);
client.listen("interactions", 3000, () => {
console.log("Server is active with the interaction webhook at /interactions");
});