Skip to content

SprtnDio/Complete-Local-Discord-AI-Voice-Chat-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sprtn AI - Complete offline useable - Insulting Voice AI Discord Bot (Powered by Llama 3)

Warning: This Discord bot is designed for fun and entertainment purposes only. It is intentionally programmed to generate insulting and offensive responses. Use it responsibly and only with friends who understand its nature and are comfortable with its humor. It is not intended for use in public or professional environments.

Project Description:

Oracle is an advanced Discord bot integrating voice-to-text, AI text generation, and text-to-speech functionalities to create a unique and interactive experience. Summon the Oracle to your voice channel and ask it questions using voice or text commands. Be prepared for cryptic, often insulting, and humorous answers generated by the Llama 3 language model!

MIT License Discord.js Version Node.js Required

🌟 Features

  • 🎙️ Voice-to-Text (Speech Recognition): Powered by Vosk ASR for real-time voice command recognition.
  • 🔊 Text-to-Speech (Voice Synthesis): Utilizes Piper TTS to vocalize the Oracle's responses.
  • 🧠 AI-Powered Text Generation: Integrated with the Llama 3 language model to generate creative and contextually relevant (though often insulting!) answers.
  • 🎚️ Voice Channel Management: Easily summon and dismiss the bot from voice channels with admin commands.
  • ⏱️ Activity Timeout System: Automatically deactivates voice command listening after a period of inactivity.
  • ⚙️ Customizable Settings: Administrators can configure various bot behaviors via the settings.json file.
  • 😈 Automatic Insults (Optional): Enable periodic insults directed at voice channel users for added entertainment (admin-toggleable).
  • 📝 Transcription (Optional): Enable text transcription of voice input for logging or accessibility (admin-toggleable).
  • 🧹 Message Purging (Optional): Automatic cleaning of bot command and response messages in the text channel (admin-toggleable).
  • 👋 Greeting Ceremony (Optional): Bot can automatically greet users joining the voice channel (admin-toggleable).
  • 🛠️ Debug Logging (Optional): Detailed debug logs can be enabled for troubleshooting (admin-toggleable).

🚀 Prerequisites

Before you begin, ensure you have the following installed and set up:

  1. Node.js and npm:
    • Download and install Node.js (version 18 or higher recommended) from https://nodejs.org/. npm (Node Package Manager) is usually included with Node.js.
  2. Discord Bot Token:
    • Create a Discord Bot application and obtain your bot token from the Discord Developer Portal.
    • You will need to invite your bot to your Discord server and grant it the necessary permissions (Voice permissions, Read Messages, Send Messages, etc.).
  3. Ollama:
    • Install Ollama to run the Llama 3 language model. Follow the installation instructions on the Ollama website.
    • Ensure you have the desired Llama 3 model available in Ollama. The default model specified in config.ORACLE_SETTINGS.MODEL_NAME is hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest.
  4. Piper TTS (Text-to-Speech):
    • Download and install Piper TTS. You can find pre-built binaries and models on the Piper TTS repository.
    • Download a Piper TTS voice model (e.g., German de_DE-thorsten-high.onnx or an English model if you prefer).
  5. Vosk API:
    • Install the Vosk API for speech recognition. Instructions can be found on the Vosk website.
    • Download a Vosk speech recognition model for your desired language (e.g., vosk-model-de-0.21 for German or an English model).
  6. FFmpeg:

🛠️ Installation

Follow these steps to set up and run the Oracle bot:

  1. Clone the repository:

    git clone https://github.com/SprtnDio/Complete-Local-Discord-AI-Voice-Chat-Bot
    cd Complete-Local-Discord-AI-Voice-Chat-Bot
  2. Install Node.js modules:

    npm install

    This command will install all necessary dependencies listed in package.json, including:

    • vosk
    • prism-media
    • discord.js
    • @discordjs/voice
  3. Configure settings.json:

    • Create a file named settings.json in the root directory of your project.

    • Copy and paste the following template into settings.json and replace the placeholder values with your actual paths and Discord Bot Token:

      {
        "DISCORD_TOK": "YOUR_DISCORD_BOT_TOKEN_HERE",
        "PATHS": {
          "TTS_MODEL_PATH": "/path/to/your/piper_tts_model.onnx",
          "TTS_EXECUTABLE_PATH": "/path/to/your/piper",
          "VOSK_MODEL_PATH": "/path/to/your/vosk_model",
          "TEMP_AUDIO_DIR": "/path/to/your/temp_audio_directory",
          "TRIGGER_SOUND_PATH": "/path/to/your/optional_trigger_sound.wav"
        }
      }

      Explanation of settings.json paths:

      • DISCORD_TOK: Required. Your Discord Bot Token obtained from the Discord Developer Portal.
      • PATHS.TTS_MODEL_PATH: Required. The absolute path to your Piper TTS voice model file (e.g., de_DE-thorsten-high.onnx).
      • PATHS.TTS_EXECUTABLE_PATH: Required. The absolute path to the Piper TTS executable file (e.g., piper.exe or piper).
      • PATHS.VOSK_MODEL_PATH: Required. The absolute path to your Vosk speech recognition model directory (e.g., vosk-model-de-0.21).
      • PATHS.TEMP_AUDIO_DIR: Optional. The directory where Piper TTS will store temporary .wav audio files. You can use "." to use the project's root directory, or specify a different path.
      • PATHS.TRIGGER_SOUND_PATH: Optional. The absolute path to a .wav audio file that will be played in the voice channel when the wake word is detected. If you don't want a trigger sound, you can leave this path empty or remove the line.
    • Example settings.json (adjust paths to your system):

      {
        "DISCORD_TOK": "YOUR_DISCORD_BOT_TOKEN",
        "PATHS": {
          "TTS_MODEL_PATH": "C:\\piper\\models\\de\\de_DE\\thorsten\\high\\de_DE-thorsten-high.onnx",
          "TTS_EXECUTABLE_PATH": "C:\\piper\\piper.exe",
          "VOSK_MODEL_PATH": "C:\\vosk\\vosk-model-de-0.21",
          "TEMP_AUDIO_DIR": ".",
          "TRIGGER_SOUND_PATH": "C:\\sounds\\trigger.wav"
        }
      }
  4. Run the bot:

    node bot.js  # Or the name of your main bot file if different

    The bot should now start and connect to Discord. Check your console for any error messages.

⌨️ Commands

User Commands:

  • !help: Displays a help message with all available commands.
  • !ask [question]: Ask the Oracle a question via text. The bot will respond with a text and voice answer.
  • [Wake Word] [question]: Activate voice command recognition by saying the wake word (default: "orakel") followed by your question in the voice channel. The bot will respond with a text and voice answer.

Administrator Commands (require Administrator permissions on the Discord server):

  • !join: Summon the bot to join your current voice channel.
  • !leave: Dismiss the bot and make it leave the voice channel.
  • !purge <on/off>: Enable or disable automatic purging of bot messages in the text channel.
  • !greetings <on/off>: Enable or disable automatic greeting messages when users join the voice channel.
  • !debug <on/off>: Enable or disable debug logging to the console.log file.
  • !text <on/off>: Enable or disable text transcription of voice input in the text channel.
  • !insult <on/off>: Enable or disable automatic, periodic insults in the voice channel.

📜 Licensing

This project incorporates components with the following licenses:

Code:

  • Oracle - Insulting Voice AI Discord Bot (this project's code): MIT License

Language Models & Datasets:

  • Llama 3 Model: Meta Llama 3 Community License (Non-Commercial) - Llama 3 is intended for research and non-commercial use. Please adhere to the terms of this license.
    • Specific Model Used: hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest (Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF on Hugging Face) - This bot utilizes this specific variant of the Llama 3 model, which is designed to be "uncensored" and may produce more unfiltered responses.
  • Piper TTS Voice Models: Varies, often CC BY-NC-SA 4.0 - Piper TTS voice models may be licensed under various Creative Commons licenses, often including Non-Commercial and ShareAlike restrictions. Check the specific license of the voice model you use.
  • Vosk ASR Models: Apache 2.0 License

Software Libraries:

Please be aware of and respect the licensing terms for all components used in this project, especially if you intend to use it for anything beyond personal, non-commercial fun.


Disclaimer: This bot is provided as-is for educational and entertainment purposes. The developer is not responsible for any misuse or offense caused by the bot's generated content. Use responsibly and at your own discretion.


Enjoy the chaotic wisdom of the Oracle!

⠀⠀⠀⠀⠀⢀⣀⢠⣴⣶⣶⣶⣆⣤⣄⣀⠀⠀ ⠀⠀⢀⣤⣾⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠆ ⠀⢀⣺⣿⣿⣿⠿⣛⣭⣥⣴⣤⣬⣍⠛⠉⠀⠀ ⢀⣿⣿⣿⡿⡡⣚⣭⣵⣶⣦⣭⣙⠃⠀⠀⠀⠀ ⢸⣿⣿⣿⢁⣾⣿⠿⢛⣋⣉⣉⣉⣓⣠⠀⠀⠀ ⢸⣿⣿⡏⢸⣿⢇⣾⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀ ⢸⣿⡿⠁⣸⣿⡸⣿⣿⣿⡉⠀⠉⢻⣿⠀⠀⠀ ⠚⠋⠀⠀⣿⣿⣿⣮⢻⣿⣿⣷⣆⠀⣿⠀⠀⠀ ⠀⠀⠀⢀⣿⣿⣿⣿⡇⢿⣿⣿⣿⡄⠉⠀⠀⠀ ⠀⠀⠀⠉⠛⠛⠛⠋⠁⢸⣿⣿⣿⣿⣄⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠛⠿⠿⠿⠛⠁⠀

Bot by SprtnDio

About

AI Discord bot that acts as an insulting oracle. Ask questions by voice or text - prepare for roasts!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors