New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@gcommands/expressinteraction

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@gcommands/expressinteraction

Express Interaction Handler

unpublished
latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

GExpressInteraction

NPM version NPM downloads Code Raiting

NPM Banner

EXPRESS VERSION OF GCOMMANDS

Installation

Install with npm / yarn / pnpm:

npm install @gcommands/expressinteraction
yarn add @gcommands/expressinteraction
pnpm add @gcommands/expressinteraction

Usage

You go to your bot at https://discord.com/developers and copy the publicKey which you then put into the clientPublicKey parameter. In the Interaction Endpoint Url you put your site url and to that endpoint which you then put in the interactionEnpoint parameter, for example /interactions so in the discord panel you put https://example.com/interactions.

You can receive interactions via the GExpressInteraction event

// Without CMD Handler
const { GExpressInteraction } = require("@gcommands/expressinteraction");

let g = new GExpressInteraction({
  interactionEndpoint: "/interactions", // Interactions Endpoint URL 
  clientPublicKey: process.env.publicKey, // Public Key from https://discord.com/developer/applications/:ID/information
  port: 3e3 // express port
})

g.on("GExpressInteraction", (interaction) => {
  if(interaction.isCommand()) {
    interaction.send("po") // https://gcommands.js.org/docs/#/docs/main/main/typedef/GPayloadOptions
  }
})

// With CMD Handler
const { GExpressInteraction } = require("@gcommands/expressinteraction");

let g = new GExpressInteraction({
  cmdDir: "cmds/",
  interactionEndpoint: "/interactions", // Interactions Endpoint URL 
  clientPublicKey: process.env.publicKey, // Public Key from https://discord.com/developer/applications/:ID/information
  port: 3e3 // express port
})

If you want a straight cmd handler, you can create for example test.js in cmds/ and put it there:

const { Command } = require("@gcommands/expressinteraction")

module.exports = class extends Command {
  constructor(...args) {
    super(...args, {
      name: "test"
    })
  }

  run({respond}, arrayArgs, args) {
    respond("hello")
  }
}

To create a slash command, go to panel. GExpressInteraction is used only for the handle.

FAQs

Package last updated on 26 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts