1.0.2 • Published 2 years ago

discord-http-interaction v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

discord-http-interaction

Install

$ npm i discord-http-interaction@latest

Usage

// client is Discord.js Client
// express is Express Server || undefined || null

const { Client } = require('discord.js');

/* Option
const express = require('express');
const app = express();
*/

const client = new Client({
    // Your Client Options
});

const Interaction = require('discord-http-interaction');

function callback(data) {
    return client.actions.InteractionCreate.handle(data);
}

Interaction(app, {
    port: process.env.PORT || 3000,
    publicKey: process.env.PUBLIC_KEY,
}, callback);

client.on("interactionCreate", async interaction => {
    // Your Code
});

client.login(process.env.TOKEN);