@thataaaaaa/kraftjs
v1.0.1
Published
Modern Discord framework
Downloads
258
Maintainers
Readme
⚡ Arlecchino Bot Framework (KraftJS)
Framework base para criação de bots Discord com WebSocket, sistema de comandos, interações avançadas e gerenciamento completo de guilds.
Inspirado na arquitetura de bots modernos e otimizado para performance e escalabilidade.
🚀 Instalação
npm install @thataaaa/kraftjs🤖 Bot oficial (Arlecchino)
🔗 Bot: https://discord.com/oauth2/authorize?client_id=1441027871069048902
🛠️ Suporte / Updates: https://discord.gg/WjeVXJPn5p
⚙️ Exemplo básico
const KraftClient = require('@thataaaa/kraftjs');
const client = new KraftClient({
token: 'SEU_TOKEN',
clientId: 'SEU_CLIENT_ID',
intents: 0
});
client.on('ready', (data) => {
console.log(`🤖 Online como ${data.user.username}`);
});
client.connect();💬 Criando um comando
client.command({
name: 'ping',
async execute(interaction, client) {
await client.api.request(
`/interactions/${interaction.id}/${interaction.token}/callback`,
{
method: 'POST',
body: {
type: 4,
data: {
content: '🏓 Pong!'
}
}
}
);
}
});📦 Registrando comandos
await client.ConfigCommands(null, [
{
name: 'ping',
description: 'Responde Pong!'
}
]);🎮 Status do bot
client.setStatus({
name: 'Arlecchino Framework',
type: 0,
status: 'online'
});📡 Eventos principais
client.on('connect', () => {});
client.on('ready', () => {});
client.on('interactionCreate', () => {});
client.on('commandExecute', () => {});
client.on('commandError', () => {});
client.on('gatewayError', () => {});🧩 InteractionManager
🔘 Botão
const button = client.interactions.createButton({
user: interaction.member.user.id,
tempo: ms('10m'),
funcao: async (i, client) => {
console.log('clicado');
},
data: {
label: 'Clique',
style: 1
}
});📋 Select
const select = client.interactions.createSelect({
user: interaction.member.user.id,
tempo: ms('10m'),
funcao: async (i, client) => {
console.log('select');
},
data: {
placeholder: 'Escolha',
options: [{ label: 'Opção', value: '1' }]
}
});🪟 Modal
const modal = client.interactions.createModal({
user: interaction.member.user.id,
tempo: ms('10m'),
title: 'Modal',
components: [],
funcao: async (i, client, fields) => {
console.log(fields);
}
});⚙️ Resumo
IDs temporários
Expiração automática
Apenas usuário autorizado
Erros tratados automaticamente
⚠️ Aviso
Este framework está em desenvolvimento ativo e pode sofrer mudanças estruturais.
Use em produção com cautela.
👑 Projeto
Arlecchino Bot Framework Desenvolvido por @thataaaa
🤖 Bot oficial: https://discord.com/oauth2/authorize?client_id=1441027871069048902
🛠️ Suporte / Updates: https://discord.gg/WjeVXJPn5p
