teto_ai/test/basic_test.js
Mikolaj Wojciech Gorski 44b45b7212 Major refactor: Transform into AI-powered Kasane Teto companion bot
🎭 Core Transformation:
- Reframe project as AI companion bot with Kasane Teto personality
- Focus on natural conversation, multimodal interaction, and character roleplay
- Position video recording as one tool in AI toolkit rather than main feature

🏗️ Architecture Improvements:
- Refactor messageCreate.js into modular command system (35 lines vs 310+)
- Create dedicated videoRecording service with clean API
- Implement commandHandler for extensible command routing
- Add centralized configuration system (videoConfig.js)
- Separate concerns: events, services, config, documentation

📚 Documentation Overhaul:
- Consolidate scattered READMEs into organized docs/ directory
- Create comprehensive documentation covering:
  * AI architecture and capabilities
  * Natural interaction patterns and personality
  * Setup guides for AI services and Docker deployment
  * Commands reference focused on conversational AI
  * Troubleshooting and development guidelines
- Transform root README into compelling AI companion overview

🤖 AI-Ready Foundation:
- Document integration points for:
  * Language models (GPT-4/Claude) for conversation
  * Vision models (GPT-4V/CLIP) for image analysis
  * Voice synthesis (ElevenLabs) for speaking
  * Memory systems for conversation continuity
  * Personality engine for character consistency

🔧 Technical Updates:
- Integrate custom discord.js-selfbot-v13 submodule with enhanced functionality
- Update package.json dependencies for AI and multimedia capabilities
- Maintain Docker containerization with improved architecture
- Add development and testing infrastructure

📖 New Documentation Structure:
docs/
├── README.md (documentation hub)
├── setup.md (installation & AI configuration)
├── interactions.md (how to chat with Teto)
├── ai-architecture.md (technical AI systems overview)
├── commands.md (natural language interactions)
├── personality.md (character understanding)
├── development.md (contributing guidelines)
├── troubleshooting.md (problem solving)
└── [additional specialized guides]

 This update transforms the project from a simple recording bot into a foundation for an engaging AI companion that can naturally interact through text, voice, and visual content while maintaining authentic Kasane Teto personality traits.
2025-07-26 13:08:47 +02:00

99 lines
3.2 KiB
JavaScript

import { Client } from "discord.js-selfbot-v13";
// Test configuration
const TEST_TOKEN = process.env.USER_TOKEN;
const TEST_USER_ID = "339753362297847810"; // Replace with your Discord user ID for testing
if (!TEST_TOKEN) {
console.error("USER_TOKEN environment variable is required for testing");
process.exit(1);
}
const client = new Client({ checkUpdate: false });
client.on("ready", async () => {
console.log(`✅ Test bot ${client.user.username} is ready!`);
console.log("📋 Available test scenarios:");
console.log("1. Send a DM to yourself with 'teto' to test DM pickup");
console.log("2. In a server, type 'xbox record that' to test recording command");
console.log("3. Type 'hello teto' to test basic greeting");
console.log("4. Type 'stop recording' or 'xbox stop' to test stop command");
console.log("\n🔍 Monitoring messages for test responses...");
});
client.on("messageCreate", async (message) => {
// Skip bot's own messages
if (message.author.id === client.user.id) return;
console.log(`📨 Message received: "${message.content}" from ${message.author.tag}`);
// Test DM pickup
if (message.channel.type === "DM" && message.content.toLowerCase().includes("teto")) {
console.log("✅ DM pickup test - Bot should respond");
}
// Test recording command
if (message.content.toLowerCase() === "xbox record that") {
console.log("✅ Recording command test - Bot should attempt to start recording");
// Check if user is in voice channel
const member = message.guild?.members.cache.get(message.author.id);
const voiceChannel = member?.voice?.channel;
if (voiceChannel) {
console.log(`🔊 User is in voice channel: ${voiceChannel.name}`);
} else {
console.log("❌ User is not in a voice channel");
}
}
// Test hello command
if (message.content.toLowerCase().includes("hello teto")) {
console.log("✅ Hello command test - Bot should respond with greeting");
}
// Test stop command
if (message.content.toLowerCase() === "stop recording" || message.content.toLowerCase() === "xbox stop") {
console.log("✅ Stop recording command test - Bot should attempt to stop recording");
}
});
client.on("error", (error) => {
console.error("❌ Client error:", error);
});
client.on("disconnect", () => {
console.log("🔌 Client disconnected");
});
// Test voice channel capabilities
client.on("voiceStateUpdate", (oldState, newState) => {
if (newState.member.id === client.user.id) {
if (newState.channel) {
console.log(`🔊 Bot joined voice channel: ${newState.channel.name}`);
} else if (oldState.channel) {
console.log(`🔇 Bot left voice channel: ${oldState.channel.name}`);
}
}
});
// Graceful shutdown
process.on("SIGINT", () => {
console.log("\n🛑 Shutting down test bot...");
client.destroy();
process.exit(0);
});
// Login and start test
console.log("🚀 Starting test bot...");
client.login(TEST_TOKEN).catch((error) => {
console.error("❌ Failed to login:", error);
process.exit(1);
});
// Auto-shutdown after 5 minutes
setTimeout(() => {
console.log("\n⏰ Test session timeout - shutting down");
client.destroy();
process.exit(0);
}, 300_000);