0.0.3 • Published 2 years ago

slash4eris v0.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago