ryuziii.js
v1.0.1
Published
High-performance Discord API library optimized for music bots and advanced applications
Maintainers
Readme
A high-performance, developer-friendly Discord API wrapper for JavaScript with built-in builders, convenient methods, and advanced features. No more client.rest.request() - just clean, simple code that actually makes sense! Perfect for music bots and large-scale applications.
Table of Contents
Features
- 🎯 Developer Friendly:
client.sendMessage()instead ofclient.rest.request()- finally! - 🏗️ Built-in Builders: EmbedBuilder, SlashCommandBuilder, MessageBuilder included
- ⚡ Fast & Lightweight: Minimal memory and CPU usage, perfect for heavy-load and large bots
- 🎵 Music Bot Ready: Full voice connection support with Opus streaming
- 📡 Auto Sharding: Built-in sharding for bots in 1000+ servers
- 🎨 Rich Features: Color names (
'success','error'), preset embeds, easy interactions - 💾 Smart Caching: LRU cache with automatic memory management and cleanup
- 🔧 TypeScript Ready: Full TypeScript definitions included
Installation
npm install ryuziii.jsQuick Start
The Old Way vs ryuziii.js Way ✨
Other libraries 😭:
// The hard way
await client.rest.request('POST', `/channels/${id}/messages`, {
embeds: [{ title: 'Hello', color: 0x00ff00, timestamp: new Date().toISOString() }]
});ryuziii.js 😍:
// Clean, simple, beautiful!
const embed = new EmbedBuilder()
.setTitle('Hello')
.setColor('success')
.setTimestamp();
await client.sendMessage(id, { embeds: [embed] });Basic Bot
const { Client, Constants, EmbedBuilder } = require('ryuziii.js');
const client = new Client({
intents: Constants.INTENTS.GUILDS | Constants.INTENTS.GUILD_MESSAGES | Constants.INTENTS.MESSAGE_CONTENT
});
client.on('ready', () => {
console.log('Bot is ready!');
client.setPlaying('with ryuziii.js'); // Easy status!
});
client.on('messageCreate', async (message) => {
if (message.content === '!ping') {
const embed = new EmbedBuilder()
.setTitle('🏓 Pong!')
.setColor('success')
.addField('Latency', `${client.ping}ms`, true);
await client.sendMessage(message.channel_id, { embeds: [embed] });
}
});
client.login('YOUR_BOT_TOKEN');Usage
Slash Command Example
const { SlashCommandBuilder, EmbedBuilder } = require('ryuziii.js');
// Register command
const pingCommand = new SlashCommandBuilder()
.setName('ping')
.setDescription('Check bot latency');
// Handle interaction
client.interactions.addSlashCommand('ping', async (interaction) => {
const embed = new EmbedBuilder()
.setTitle('🏓 Pong!')
.addField('Latency', `${client.ping}ms`, true)
.setColor('success');
await interaction.reply({ embeds: [embed] });
});Advanced Usage
Event Folder Loader
// Load all events from a folder
require('fs').readdirSync('./events').forEach(file => {
const event = require(`./events/${file}`);
client.on(file.replace('.js', ''), (...args) => event(client, ...args));
});Command Folder Loader
// Load all commands from a folder
const commands = new Map();
require('fs').readdirSync('./commands').forEach(file => {
const command = require(`./commands/${file}`);
commands.set(command.name, command);
});Register Slash Commands (Global or Per-Guild)
const { SlashCommandBuilder } = require('ryuziii.js');
// Create your command
const pingCommand = new SlashCommandBuilder()
.setName('ping')
.setDescription('Check bot latency');
// Register globally (available in all servers, takes up to 1 hour)
await client.createSlashCommand(null, pingCommand);
// OR register for specific guild only (instant, for testing)
await client.createSlashCommand('YOUR_GUILD_ID', pingCommand);
// Handle the command
client.interactions.addSlashCommand('ping', async (interaction) => {
await interaction.reply('🏓 Pong!');
});Built-in Client Methods
// Easy messaging - Choose your style!
// Direct approach
await client.sendMessage(channelId, 'Hello!');
await client.editMessage(channelId, messageId, 'Updated!');
await client.deleteMessage(channelId, messageId);
// Discord.js-like approach
await message.channel.send('Hello!');
await message.reply('Hello!');
await message.edit('Updated!');
await message.delete();
await message.react('👍');
// Status management
client.setPlaying('music');
client.setListening('commands');
client.setWatching('for errors');
client.setDND(); // or setOnline(), setIdle(), setInvisible()
// Voice channels
await client.joinVoiceChannel(guildId, channelId);
await client.leaveVoiceChannel(guildId);
// Moderation
await client.kickMember(guildId, userId, 'Breaking rules');
await client.banMember(guildId, userId, { reason: 'Spam' });Sharding Example
const { ShardManager } = require('ryuziii.js');
const manager = new ShardManager('./bot.js', {
totalShards: 'auto',
token: 'YOUR_BOT_TOKEN'
});
manager.spawn();Voice/Music Example
const { VoiceConnection } = require('ryuziii.js');
// Join voice channel
await client.joinVoiceChannel(guildId, channelId);
// Create voice connection
const voiceConnection = new VoiceConnection(client, guildId, channelId);
voiceConnection.playOpusStream(audioStream);Example Bot
A full-featured example bot is included in the examples/ folder!
EmbedBuilder Example
const { EmbedBuilder } = require('ryuziii.js');
// Beautiful embeds with color names!
const embed = new EmbedBuilder()
.setTitle('✨ Success!')
.setDescription('This is so much easier!')
.addField('Before', 'Hard to use APIs', true)
.addField('Now', 'Clean and simple!', true)
.setColor('success') // or 'error', 'warning', 'info', 'discord'
.setThumbnail('https://example.com/image.png')
.setFooter('Made with ryuziii.js')
.setTimestamp();
await client.sendMessage(channelId, { embeds: [embed] });Advanced Examples
See our example files for complete implementations:
examples/basic.js- Simple bot with modern featuresexamples/advanced-bot.js- Full-featured botexamples/music-bot.js- Voice connections & musicexamples/sharding.js- Sharding for large bots
Tip:
Explore theexamples/directory for more usage patterns and advanced features!
Contributors
| Ryuzii | Other Contributor | |:---:|:---:|
Want to help? Open an issue or PR!
Contributing
We welcome contributions! Please:
- Fork the repo
- Open a pull request
- Follow the code style and add tests/examples if possible
- Add yourself to the contributors list in package.json and README
License
MIT License
Copyright (c) 2025 Ryuzii
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.