0.2.1 • Published 3 years ago

koia v0.2.1

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

Koia

A scalable Eris command framework that supports both text-based and slash commands.

Overview

Koia splits up groups of commands and listeners into plugins. They can be unloaded and loaded as required and has many features to make bot creation easy.

It has many features, including but not limited to:

  • Modular plugin-based system.
  • Ability to have states for providing plugin data.
  • Support for both text-based and slash commands.
  • Clean and performant code.

Examples

Typescript:

import { Client, plugin, textCommand } from 'koia';

// Register a text-based command.
const command = textCommand({
  name: 'ping',
  run: ({ message }) => {
    return message.channel.send('Pong!');
  }
});

// Register a plugin.
const utility = plugin({
  name: 'utility',
  commands: [command],
  onLoad: () => console.log('Loaded utility plugin!')
});

const client = new Client({
  // token, intents, plugins, and prefix are the required options.
  token: 'BOT_TOKEN',
  intents: ['guilds', 'guildMessages'],
  plugins: [utility],
  prefix: '!'
});

// Connect and startup the bot.
client.login();

JavaScript:

const { Client, plugin, slashCommand } = require('koia');

// Register a slash command.
const command = slashCommand({
  name: 'ping',
  description: 'Pings the bot.',
  options: [],

  run: ({ interaction, pluginData }) => {
    return interaction.reply(pluginData.state.value); // owo
  }
});

const utility = plugin({
  name: 'utility',
  slashCommands: [command],

  state: {
    value: 'owo'
  },

  onLoad: () => console.log('Loaded utility plugin!')
});

const client = new Client({
  // token, intents, plugins, and prefix are the required options.
  token: 'BOT_TOKEN',
  intents: ['guilds', 'guildMessages'],
  plugins: [utility],
  prefix: '!'
});

client.login();
0.2.0-4f51891

3 years ago

0.2.0-1b2f6cd

3 years ago

0.2.1-885d4ba

3 years ago

0.2.0-eecf15b

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.1-01c7ceb

3 years ago

0.2.1-b2c5d42

3 years ago

0.1.0

3 years ago

0.1.0-b410e7a

3 years ago

0.0.6

3 years ago

0.0.6-bd0a950

3 years ago

0.0.5-c0f7367

3 years ago

0.0.5

3 years ago

0.0.5-ff331be

3 years ago

0.0.4-12ba332

3 years ago

0.0.4

3 years ago

0.0.4-ee3745a

3 years ago

0.0.4-03d042e

3 years ago

0.0.3

3 years ago

0.0.3-0b1fc19

3 years ago

0.0.3-512eaad

3 years ago

0.0.2

3 years ago

0.0.2-4d846c7

3 years ago

0.0.1-1bc52a3

3 years ago

0.0.1-564b39b

3 years ago

0.0.1

3 years ago

0.0.1-263de40

3 years ago

0.0.1-0cc8481

3 years ago

0.0.1-0ed1b6b

3 years ago