A sophisticated Discord bot featuring NVIDIA AI integration, advanced music playback, and intelligent conversations
Features | NVIDIA AI | Technologies | Installation | Configuration | Commands | License
- High-Quality Playback - Powered by Lavalink for superior audio streaming
- Multi-Platform Support - YouTube, Spotify, SoundCloud, Apple Music, Deezer, and more
- Advanced Queue Management - Shuffle, loop, skip, pause, and volume control
- Playlist Support - Create, save, and manage custom playlists
- Audio Filters - 10+ audio filters including bass boost, nightcore, vaporwave
- Live Stream Support - Play live streams and radio stations
- Video Streaming - Stream videos directly in Discord voice channels
- Multiple AI Models - Access to cutting-edge NVIDIA models:
- Llama 4 Maverick - General purpose multimodal model
- DeepSeek R1 - Advanced reasoning and analysis
- Qwen 2.5 Coder - Specialized programming assistant
- Llama 3.x Series - Various sizes for different needs
- Intelligent Conversations - Context-aware chat with memory and personality
- Code Analysis & Generation - Write, review, debug, and optimize code
- Advanced Reasoning - Solve complex problems with step-by-step analysis
- Streaming Responses - Real-time AI responses for better interactivity
- Multi-Modal Support - Process text and images (vision models)
- User Memory - Remembers preferences, interests, and interaction patterns
- Conversation Context - Maintains context across messages for coherent discussions
- Personality System - 8 different AI personalities (Friendly, Professional, Playful, DJ, Wise, Technical, Gamer, Teacher)
- Learning System - Learns from user interactions to provide better responses
- Sentiment Analysis - Understands user emotions and responds appropriately
- Multi-Language Support - 8+ languages including English, Portuguese, Spanish, French, German
- Custom Prefix - Configurable command prefix per server
- Permission System - Granular permission control for commands
- Database Integration - MongoDB/Prisma for persistent data storage
- Dashboard - Web interface for bot configuration (optional)
- Auto-Restart - PM2 support for production deployments
- 78 Total Commands - Organized into 10 categories
- Slash Command Support - Modern Discord slash commands
- Button & Menu Interactions - Interactive UI components
- Error Handling - Robust error handling and logging
- Performance Monitoring - Built-in stats and monitoring
- Developer Tools - Eval, shell, and other dev commands
Mahina Bot leverages NVIDIA's cutting-edge AI models through their API to provide intelligent assistance:
Model | Use Case | Context | Highlights |
---|---|---|---|
Llama 4 Maverick 17B | Multimodal AI with image & text support | 128K | 🌟 Latest model, MoE architecture |
Nemotron Ultra 253B | Scientific reasoning & complex math | 128K | 🚀 Highest accuracy, enterprise |
DeepSeek R1 | Advanced reasoning, problem-solving | 8K | 🧠 Step-by-step analysis |
Qwen 2.5 Coder 32B | Programming, code review & optimization | 32K | 💻 Specialized for developers |
Phi 4 Multimodal | Audio, image & text understanding | 16K | 🎙️ Multi-input processing |
Cosmos Predict 7B | Physics simulations & world modeling | 4K | 🌍 Physical AI applications |
# Chat with AI
!chat <message> # General AI chat with context
!chat vision <image> <question> # Analyze images with AI
!chat reasoning <problem> # Advanced step-by-step reasoning
!mahinai <message> # Enhanced AI with memory, personality & learning
!code <task> <language> # Code generation and analysis
!model list # View all 14+ available models
!model select llama-4-maverick # Switch to specific AI model
!model stats # View usage statistics
!aistatus # View your personal AI stats
- Time-Series AI Analytics - Track model performance over time
- Vector Search with pgvector - Semantic search through conversation history
- pgai Extensions - Direct AI model calls from database
- Continuous Aggregates - Real-time metrics and insights
- Async AI Processing - Handle long-running AI tasks
- Batch Operations - Process multiple requests efficiently
- Scheduled Jobs - Recurring AI tasks and analysis
- Priority Queue - Important requests processed first
- RAG (Retrieval Augmented Generation) - Context-aware responses using vector search
- Multi-Model Support - 14+ specialized models for different tasks
- Streaming Responses - Real-time AI output for better UX
- Image Analysis - Vision models for image understanding
- Code Intelligence - Advanced code analysis, debugging, and generation
// Using the new Llama 4 Maverick model
const response = await nvidiaService.chat(userId, 'Analyze this image and explain what you see', {
model: 'llama-4-maverick',
images: ['https://example.com/image.jpg'],
stream: true,
})
// Queue an AI job for background processing
const jobId = await aiJobService.queueJob({
type: 'embedding',
userId: '123',
guildId: '456',
data: {
content: 'Generate embeddings for this text',
contentType: 'message',
},
priority: 1,
})
- TypeScript - Type-safe JavaScript
- Node.js - JavaScript runtime
- Discord.js - Discord API wrapper
- Lavalink - Audio streaming server
- TimescaleDB - Time-series PostgreSQL
- pgvector - Vector similarity search
- pgai - AI functions in PostgreSQL
- pg-boss - Job queue for Node.js
- Redis - Caching and pub/sub
- Prisma - Modern database ORM
- NVIDIA AI - 14+ AI models including Llama 4
- OpenAI - Fallback AI provider
- pg_cron - Scheduled jobs in PostgreSQL
- Clone the repository
git clone https://github.com/gabrielmaialva33/mahina-bot.git
cd mahina-bot
- Install dependencies
pnpm install
# or npm install
- Configure environment
cp .env.example .env
# Edit .env with your configuration
- Start services with Docker
docker-compose up -d
- Run database migrations
pnpm db:push
- Start the bot
pnpm build && pnpm start:max
# or for development
pnpm start:dev
Create a .env
file with the following configuration:
# Discord Configuration
TOKEN=your_discord_bot_token
CLIENT_ID=your_discord_client_id
# Database
DATABASE_URL=mongodb://localhost:27017/mahina
# Lavalink Nodes
NODES=[{"id":"main","host":"localhost","port":2333,"authorization":"youshallnotpass"}]
# AI Configuration
NVIDIA_API_KEY=your_nvidia_api_key # Get from build.nvidia.com
OPENAI_API_KEY=your_openai_api_key # Optional fallback
# Bot Settings
PREFIX=!
DEFAULT_LANGUAGE=EnglishUS
BOT_ACTIVITY=Music & AI
BOT_STATUS=online
# Optional Features
GENIUS_API=your_genius_api_key # For lyrics
TOPGG=your_topgg_token # For bot lists
PORT=3050 # Web dashboard port
The included docker-compose.yml
provides:
- Lavalink server
- MongoDB database
- Optional: Bot container
play
,pause
,resume
,stop
,skip
,previous
queue
,nowplaying
,shuffle
,loop
,volume
seek
,replay
,remove
,clear
,jump
grab
,move
,skipto
,lyrics
chat
,mahinai
,code
,reason
,stream
model
,aistatus
,vision
,tools
filter
,bassboost
,nightcore
,vaporwave
8d
,distortion
,karaoke
,tremolo
,vibrato
playlist create
,playlist add
,playlist remove
playlist list
,playlist load
,playlist delete
prefix
,language
,setup
,reset
247
,autoplay
,voteskip
help
,info
,invite
,ping
,stats
node
,lavalink
,support
live
,radio
,video
,twitch
mixer
,podcast
,soundcloud
eval
,shell
,reload
,restart
blacklist
,maintenance
,simulate
import { NvidiaAIService } from './services/nvidia_ai_service'
// Initialize service
const aiService = new NvidiaAIService(process.env.NVIDIA_API_KEY)
// Chat with AI
const response = await aiService.chat(
userId,
'Explain quantum computing',
'Make it simple for beginners'
)
// Generate code
const code = await aiService.analyzeCode(
userId,
'function fibonacci(n) { return n <= 1 ? n : fibonacci(n-1) + fibonacci(n-2); }',
'javascript',
'optimize'
)
// Stream responses
for await (const chunk of aiService.chatStream(userId, message)) {
console.log(chunk) // Print each chunk as it arrives
}
This project is under the MIT license. See LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
If you find this project helpful, please give it a star ⭐ to help others discover it!
Made with ❤️ by Maia - A passionate developer who loves cats (but is definitely not one!)
- 📧 Email: [email protected]
- 💬 Telegram: @mrootx
- 🐙 GitHub: @gabrielmaialva33
© 2017-present Maia