0.2.1 • Published 11 months ago

cordette v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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)
0.2.1

11 months ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago