slash4eris
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Slash4Eris

Create slash commands in Eris easily.


Information

As Eris has not already included interactions, we have created this module to cover this need that is becoming more important facing to April 2022.
Slash4Eris offers a quality surface to deploy Slash Commands in an Eris client. Then, using native Eris, you can reply to the interactions easily, and we teach to do so in the quick guide.

IMPORTANT: This package was created by Aidak#0001. I would like giving a star on the GitHub repository or giving me a follow.

Quick guide

Please remember that this guide is written for a TypeScript bot and uses ES6 syntax. If you do use server-side JavaScript with this module, please consider using require instead of import and avoiding types.

Creating commands

import s4e from 'slash4eris'
import Eris from 'eris'

const bot = new Eris.Client('TOKEN')
s4e.CommandCreate(bot, {
    type: s4e.CommandType.CHAT_INPUT,
    name: 'help',
    description: 'Shows a help menu',
    application_id: bot.user.id
})

Updating commands

import s4e from 'slash4eris'
import Eris from 'eris'

const bot = new Eris.Client('TOKEN')
s4e.CommandUpdate(bot, 'help', {
    type: s4e.CommandType.CHAT_INPUT,
    description: 'Shows a good, vibrant help menu.',
    application_id: bot.user.id
})

Deleting commands

import s4e from 'slash4eris'
import Eris from 'eris'

const bot = new Eris.Client('TOKEN')
s4e.CommandDelete(bot, 'help')

Responding to a command interaction

import s4e from 'slash4eris'
import Eris from 'eris'

const bot = new Eris.Client('TOKEN')

bot.on('rawWS', async (packet) => {
    if (packet.t === 'INTERACTION_CREATE' && packet.d.data.type === 2){
        // ...
    }
})

Contributing

If you want to contribute to Slash4Eris, please open a Pull Request on the GitHub repo

Readme

Keywords

none

Package Sidebar

Install

npm i slash4eris

Weekly Downloads

1

Version

0.0.3

License

Apache-2.0

Unpacked Size

23.9 kB

Total Files

14

Last publish

Collaborators

  • aidakgm