Skip to content

hyperdargo/Discord-AI

Repository files navigation

🤖 DTEmpire AI Bot

A powerful Discord bot with AI image generation, text-to-speech, and AI chat capabilities.

License Node.js Discord.js

✨ Live Links

📁 Project Structure

/home/container/
├── 📂 public/                    # Web interface files
│   ├── index.html              # Main web page
│   ├── style.css              # Stylesheet
│   ├── script.js              # Frontend JavaScript
│   ├── favicon.ico            # Favicon
│   └── *.png                  # Icon files
├── 📜 index.js                # Main Discord bot (Image Generation)
├── 📜 tts-bot.js              # TTS & AI Chat bot
├── 📜 server.js               # Express web server
├── 📜 start-all.js            # Startup script
├── 📜 config.json             # Configuration
├── 📜 package.json            # Dependencies
└── 📜 example.env             # Environment template

🎯 Features

🖼️ AI Image Generation

  • Generate images from text prompts using multiple AI models
  • Supported models: flux, seeddream, turbo, kontext
  • Web dashboard for image generation
  • Recent images gallery
  • Customizable image dimensions

🔊 Advanced Text-to-Speech

  • Convert text to speech in multiple languages
  • AI-enhanced TTS with better pronunciation
  • Voice channel integration
  • Auto-TTS reply channels
  • Randomized voice variations

🤖 AI Chat Assistant

  • Intelligent chat responses
  • Context-aware conversations
  • Auto-AI reply channels
  • Multiple language support

🌐 Web Interface

  • Beautiful, responsive web dashboard
  • Generate images without Discord
  • View image generation history
  • Copy prompts and download images
  • Bot status monitoring

🚀 Quick Start

1. Add the Bot to Your Server

Add Bot

2. Try the Web Demo

Live Demo

3. Join Support Server

Join Server

📋 Discord Commands

Image Generation Commands

Command Description Example
.imggen <prompt> Generate AI image .imggen sunset over mountains
.imggen <prompt> --model <model> Generate with specific model .imggen dragon --model turbo
.help-ai Show AI image help .help-ai

TTS Commands

Command Description Example
.tts <text> Text to speech .tts hello world
.tts --ai <text> AI-enhanced TTS .tts --ai welcome everyone
.ttsvoice <text> Play in voice channel .ttsvoice join our server
.tts --lang <code> <text> Specific language .tts --lang ne नमस्ते

AI Chat Commands

Command Description Example
.ai <prompt> Chat with AI .ai tell me a joke
.aitts <prompt> AI + TTS response .aitts explain quantum physics

Utility Commands

Command Description Example
.help Show all commands .help
.help-tts TTS commands help .help-tts
.ping Check bot latency .ping
.language Language settings .language

Admin Commands (Server Owner)

Command Description Example
.setchannel-ai #channel Set AI auto-reply channel .setchannel-ai #ai-chat
.setchannel-tts #channel Set TTS auto-reply channel .setchannel-tts #voice-chat
.checkchannels View configurations .checkchannels

🛠️ Self-Hosting

Prerequisites

  • Node.js 18 or higher
  • Discord Bot Token
  • Git

Installation

  1. Clone and setup
git clone https://github.com/hyperdargo/Discord-AI
cd Discord-AI
npm install
  1. Configure environment
cp example.env .env

Edit .env file:

# Discord Bot Tokens
DISCORD_BOT_TOKEN=your_main_bot_token
DISCORD_BOT_TOKEN_2=your_tts_bot_token
CLIENT_ID=your_bot_client_id

# Server Settings
GUILD_ID=your_main_server_id
OWNER_ID=your_user_id

# Web Server
PORT=25580

# API Settings
IMAGE_API_URL=https://imggen-api.ankitgupta.com.np/api/pollination
MAX_PROMPT_LENGTH=500
DEFAULT_MODEL=flux
NODE_ENV=production
  1. Configure config.json
{
  "api_url": "https://imggen-api.ankitgupta.com.np/api/pollination",
  "port": 25580,
  "discord_invite": "http://dsc.gg/dtempire",
  "support_server": "http://dsc.gg/dtempire-server",
  "max_prompt_length": 500
}
  1. Start the application
# Start all services
node start-all.js

# Or start individually
node server.js     # Web server
node index.js      # Image generation bot
node tts-bot.js    # TTS & AI bot

⚙️ Configuration Details

config.json

{
  "api_url": "https://imggen-api.ankitgupta.com.np/api/pollination",
  "port": 25580,
  "discord_invite": "http://dsc.gg/dtempire",
  "support_server": "http://dsc.gg/dtempire-server",
  "max_prompt_length": 500,
  "default_model": "flux",
  "available_models": [
    {"id": "flux", "name": "Flux (Recommended)", "description": "Best quality images"},
    {"id": "seeddream", "name": "SeedDream", "description": "New experimental model"},
    {"id": "turbo", "name": "Turbo", "description": "Fast generation"},
    {"id": "kontext", "name": "Kontext", "description": "Premium quality"}
  ],
  "languages": [
    {"code": "en", "name": "English", "native": "English"},
    {"code": "ne", "name": "Nepali", "native": "नेपाली"},
    {"code": "hi", "name": "Hindi", "native": "हिन्दी"},
    {"code": "ja", "name": "Japanese", "native": "日本語"}
  ]
}

package.json Dependencies

{
  "dependencies": {
    "discord.js": "^14.14.1",
    "express": "^4.18.2",
    "axios": "^1.6.2",
    "@discordjs/voice": "^0.16.0",
    "dotenv": "^16.3.1"
  },
  "scripts": {
    "start": "node start-all.js",
    "web": "node server.js",
    "bot": "node index.js",
    "tts": "node tts-bot.js"
  }
}

🌐 Web Interface Features

The web interface (/public/) provides:

  1. Image Generation Panel

    • Text prompt input
    • Model selection dropdown
    • Image size options
    • Generate button
  2. Gallery Section

    • Recently generated images
    • Copy prompt button
    • Download image button
    • Model information
  3. Bot Status Panel

    • Discord bot status
    • Server count
    • Uptime information
    • Quick invite link
  4. Responsive Design

    • Mobile-friendly layout
    • Dark/light theme
    • Smooth animations
    • Loading indicators

🔧 Advanced Setup

Auto-Reply Channels Setup

  1. Create AI Auto-Reply Channel

    .setchannel-ai #ai-chat
    • Any message in this channel gets AI response
    • No commands needed
  2. Create TTS Auto-Reply Channel

    .setchannel-tts #tts-chat
    • Any message gets converted to voice file
    • Language based on user/server settings
  3. Check Current Setup

    .checkchannels

Language Configuration

User Language Setting:

.language set          # Opens language selection menu

Server Language Setting (Admin):

.language server       # Set default language for server

Available Languages:

  • en - English 🇺🇸
  • ne - Nepali 🇳🇵
  • hi - Hindi 🇮🇳
  • ja - Japanese 🇯🇵

📊 File Descriptions

File Purpose Key Features
index.js Main Discord bot Image generation, web server, gallery
tts-bot.js TTS & AI bot Text-to-speech, AI chat, voice channels
server.js Web server Express server, API endpoints
start-all.js Startup script Launches all services
public/index.html Web interface Image generation UI, gallery
public/script.js Frontend logic API calls, image display
public/style.css Styling Responsive design, animations
config.json Configuration API settings, models, languages

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📞 Support

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

🙏 Acknowledgments

  • Pollinations.ai for the image generation API
  • Discord.js community for the excellent library
  • All contributors and users of DTEmpire Bot

🚀 Getting Started for Users

For Discord Users:

  1. Add the bot to your server
  2. Use .help to see all commands
  3. Try .imggen sunset for your first AI image
  4. Join our support server for help

For Web Users:

  1. Visit imggen.ankitgupta.com.np
  2. Enter your prompt and select a model
  3. Click "Generate" to create images
  4. Download or copy prompts from the gallery

For Developers:

  1. Clone the repository
  2. Set up .env file with your tokens
  3. Run npm install and npm start
  4. Customize config.json for your needs

Made with ❤️ by Ankit Gupta | DTEmpire

Add Bot Live Demo Support

About

Chat with ai, generate image and text to speech with ai all in one for discord with website U.I

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published