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

cordette

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordette

Write Discord bot modules in style

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

Cordette

Write Discord bots in style

Cordette is a small wrapper around Discord.js that makes creating Discord bots feel more intuitive and less cumbersome. It is designed to support the Living ArtsEngine OpenBot, a collaborative and modular Discord bot that everyone in Living ArtsEngine can contribute to. It simplifies the following features:

  • Slash commands
  • Context menu commands
  • Modularity: an intermediate level of organization that groups commands and listeners and enables them to be unloaded and loaded while the bot is running

Example

import { GatewayIntentBits, Events } from 'discord.js'
import { ModuleHost } from 'cordette'
import secret from './secret'

const host = new ModuleHost(secret.token, secret.clientId)

const mod = host.module('Pong', [GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds])

mod.when(Events.MessageCreate, async msg => {
  if (msg.content.toLowerCase().trim() === 'ping!!') {
    await msg.reply('pong!!')
  }
})

host.commitStaged()
  .then(() => host.start())
  .then(() => console.log('started'))
  .catch(console.error)

Keywords

discord

FAQs

Package last updated on 18 Jun 2023

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