@shouwjs/shouw.js
v1.0.2
Published
A simple string package that help you to interacts with Discord's API easily.
Maintainers
Readme
Shouw.js
Shouw.js is a simple, string-based package that makes interacting with the Discord API easily, and fun. Inspired by Aoi.js, it allows developers to build Discord bots with minimal setup using a clean string-based command syntax, extensibility.
Installation
npm install @shouwjs/shouw.jsOr use the CLI directly to initialize a new project:
npx @shouwjs/shouw.js initGetting Started
const { ShouwClient } = require('@shouwjs/shouw.js');
const client = new ShouwClient({
token: 'YOUR_BOT_TOKEN',
prefix: '!',
intents: ['Guilds', 'GuildMessages', 'MessageContent'],
events: ['messageCreate'],
});
// Add a simple command
client.command({
name: 'ping',
code: `Pong! $pingms`,
});
// Load commands from a directory
client.loadCommands('./commands', true); // `true` enables debug loggingProject Structure Example
project/
├── index.js
├── commands/
│ ├── ping.shouw
│ ├── greet.sho
│ ├── meow.shw
│ └── fun.jsCLI Usage
Shouw.js comes with a CLI to help you bootstrap projects easily.
npx shouw initThis will:
- Create a new folder structure
- Generate a template bot file
- Install dependencies
- Provide instructions to get started
Extensions
Shouw.js also supports extensions!
const client = new ShouwClient({
extensions: [
new MyExtension({ /* options */ })
],
...
});Available extensions:
- Music - Allows you to play music in Discord voice channels.
- Database - Allows you to store and access a database for your bot.
If you want to create your own extension, you can see the extension templates for more info.
Custom Command Files
Shouw.js also supports .shouw, .sho, and .shw file extensions for commands with decorator-like syntax!
// commands/example.shouw
@Command({
name: 'hello',
});
Hello there!
This is a command code 1
@Command({
name: 'bye',
})
Goodbye!
This is a command code 2
/* Also support comments! */
// Line and block comments is supported.These decorators are parsed by Shouw.js internally, no compilation needed.
