@shadowstarrrr/orbital-discord
v1.1.5
Published
Perfeito! Vou criar um **README completo, bonito e organizado**, no estilo profissional, pronto para colocar no GitHub. Mantendo blocos de código, títulos, badges e seções claras. Aqui está:
Maintainers
Readme
Perfeito! Vou criar um README completo, bonito e organizado, no estilo profissional, pronto para colocar no GitHub. Mantendo blocos de código, títulos, badges e seções claras. Aqui está:
# 🚀 orbital-discord – Next-Gen Discord Bot Library
**orbital-discord** is a modern, modular, and fast library for building organized Discord bots. It works on top of **Discord.js**, providing a clean structure for commands, events, components, and webhooks.
---
## 📦 Installation
Use your preferred package manager:
```bash
npm install @shadowstarrrr/orbital-discordor
bun install @shadowstarrrr/orbital-discord⚙️ Initial Configuration
Create a configuration file orbital.config.ts:
import { OrbitalConfig } from '@shadowstarrrr/orbital-discord';
const config: OrbitalConfig = {
commandsPath: 'src/commands',
componentsPath: 'src/components',
eventsPath: 'src/events',
guilds: ['YOUR_GUILD_ID'],
prefix: '!',
};
export default config;🚀 Creating Your Bot
import { Intents, OrbitalClient } from "@shadowstarrrr/orbital-discord";
const bot = new OrbitalClient('YOUR_TOKEN', {
intents: Intents.Guilds, // Add more if needed
});
bot.onError(err => bot.logger.error('Unexpected error:', err));
bot.start();You can access the raw Discord.js client via
bot.client.
🧩 Creating a Command
import { defineCommand, CommandType, OptionType } from '@shadowstarrrr/orbital-discord';
import { ApplicationCommandType, ApplicationCommandOptionType } from 'discord.js';
export default defineCommand({
name: 'ping',
description: 'Replies with Pong!',
type: ApplicationCommandType.ChatInput,
CommandType: CommandType.Slash,
options: [{
name: 'test',
description: 'Test!',
type: ApplicationCommandOptionType.String,
required: true
}],
run(ctx) {
ctx.write('Pong!');
const option = ctx.getoption('test', OptionType.String);
ctx.edit(`You put: ${option}`);
},
});🧩 Creating a Component (Button Example)
import { defineComponent, ComponentType } from '@shadowstarrrr/orbital-discord';
export default defineComponent({
customId: 'example_button',
type: ComponentType.Button,
run(ctx) {
ctx.write('You clicked the button!');
const values = ctx.values(); // select menu values
const field = ctx.fields('field_id'); // modal input value
},
});🤖 Webhook Manager
import { WebhookManager } from "@shadowstarrrr/orbital-discord";
const webhook = new WebhookManager({
url: 'WEBHOOK_URL',
name: 'Webhook Name',
avatar: 'AVATAR_URL'
});
await webhook.write('Hello!');
await webhook.edit('MESSAGE_ID', 'Edited content');
await webhook.editWebhook({ name: 'New Name', avatar: 'AVATAR_URL' });
await webhook.deleteWebhook();🔧 Useful Accessors
bot.client– Raw Discord.js client instancebot.commands– Loaded command mapbot.events– Registered eventsbot.components– Registered component handlersbot.logger– Simple logging utility
