Discord AI companion bot
Find a file
Spicy Marinara 4873e50f4b
Merge pull request #3 from Geechan/fix-GLM4.7
Remove </think> reasoning tags from output (fixes GLM 4.7)
2025-12-28 22:13:13 +01:00
.DS_Store Update .DS_Store 2025-09-29 22:29:07 +02:00
.gitattributes Initial commit 2025-07-02 22:54:15 +02:00
.gitignore Update .gitignore 2025-09-24 22:55:57 +02:00
environment.yml New environment.yaml 2025-07-02 23:53:11 +02:00
launcher_linux_macos.sh Release 1.0 2025-07-02 22:58:02 +02:00
launcher_windows.bat Release 1.0 2025-07-02 22:58:02 +02:00
LICENSE Updated LICENSE 2025-07-03 10:57:45 +02:00
main.py Additional fix 2025-12-25 05:39:32 +11:00
README.md Fixed attaching images with Custom Providers 2025-07-09 14:25:17 +02:00
setup_linux_macos.sh Added banned keywords. 2025-07-03 00:15:34 +02:00
setup_windows.bat Release 1.0 2025-07-02 22:58:02 +02:00

Discord Buddy

Discord AI Companion Bot

Open source, free, with prompts written by yours truly. They're like real people, but better, because they actually talk to you!

image/jpeg

Installation

Bot

  1. Go to Discord Developer App https://discord.com/developers/applications
  2. Create a New Application for your bot.
  3. Go to the General Information tab.
  4. Name your bot and give it a profile picture and description.

image/gif

  1. Go to the Installation tab.
  2. Add "bot" in Guild Install Scope and "Administrator" in Permissions.
  3. Copy the Install Link.

image/gif

  1. Invite the bot to your selected server(s) with the link.

image/gif

  1. Return to the Installation tab in Discord Developer App and change Install Link to None, to prevent others from inviting your bot to their servers (unless you don't mind).

image/gif

  1. Go to the Bot tab.
  2. Enable Presence Intent, Server Members Intent, and Message Content Intent toggles.

image/gif

  1. Scroll to the top of the page and click the Reset Token button.
  2. Confirm, complete the authentication (if you have it), and Copy your generated token.
  3. Save the token for later (somewhere private). DO NOT SHARE IT WITH ANYONE.

image/gif

Setup

  1. Get Miniconda3 from here: https://www.anaconda.com/download/success
  2. Download all the Git files and unzip them.
  3. Go to the downloaded folder.
  4. Run one of the two setup files, depending on your system:
  • For Windows (double click it):
setup_windows.bat
  • For MacOS/Linux (in console):
cd Discord_Buddy
sh ./setup_linux_macos.sh
  1. Set your Discord Token and API Keys in .env (if it's hidden on Mac, press shift + command + . to display hidden files).

image/gif

  1. Paste your Discord token and your API Keys in the selected fields of the .env file. Remember about the quotation marks!

image/gif

  1. Run the bot through the launcher via script:
  • On Windows, double-click the launcher.
  • On MacOS/Linux, run: sh ./launcher_linux_macos.sh

That's it!

Alternatively, in case you experience any issues with the scripts, you can create a new conda environment yourself using provided 'environment.yml' file, by opening Anaconda Prompt and running following commands: cd /your/bot/location conda env create -f environment.yml - only required for the first time conda activate discord_bot python main.py

IMPORTANT: The console needs to be working in the background for the bot to work.

Multiple Bots

To have multiple bots, copy-paste your Discord Buddy folder and create for it a new application in Discord Developer App. Each bot needs a separate Discord Token and a console running.

API

My old tutorials on how to get API Keys:

Personally, I recommend grabbing a custom API Key from OpenRouter and using their free models, like DeepSeek: https://openrouter.ai/models?max_price=0

image/png

Features

🤖 AI Discord Bot

A versatile AI-powered Discord bot that brings genuine interactions, roleplay, and interactive features to your server! Work with other bots, treating them as other people! Created with spicy sauce by marinara_spaghetti. 🍝 And Claude did some coding too, let's be fair (thank you, Claude, very cool). Use /help to see all the commands.

Key Features

🧠 Multiple AI Providers

All easily connectable with a single slash command of /model_set. Just remember to add those API Keys first.

  • Claude (Anthropic) - Who doesn't love Sonnet? Even if 3.7 is better than 4.
  • Gemini (Google) - 03-25, we still miss you.
  • ChatGPT (OpenAI) - For those rare few masochists out there.
  • Custom APIs - Tested with OpenRouter and my friend's proxy. Supports connections to locally run models as well!

💬 Smart Conversations

Decide how many messages are stored in the context with /history_length.

  • Context-Aware Responses - Remembers your conversations naturally!
  • Image & Voice Support - Bots see pictures, GIFs, and voice messages (dependant on provider).
  • Bots see edited messages but not the deleted ones.
  • Emoji Reactions - Bots can use and react with emojis (supports custom server emojis, including the animated ones!).
  • Bots see other (Buddy) bots as users!
  • Autonomous Chatting (Free Will) - Decide in which channels bots will trigger autonomously with /autonomous_set!

🎭 Personality System

Decide who your bot is with /personality_create.

  • Custom Personalities - Create, edit, or delete unique bot characters for your server!
  • Per-Server Settings - Different personalities for different communities.
  • Persistent Across Restarts - Your bot's personality is saved and remembered.

🎮 Conversation Styles

Choose how your bot communicates with /prompt_set.

  • Conversational - Natural style chat with emojis and casual language.
  • Asterisk Roleplay - A roleplaying abomination style that some of you apparently like.
  • Narrative - Rich, story-driven responses with detailed descriptions.
  • NSFW variants - Uncensored versions for adult communities.

🔒 Works Everywhere

💬 Server Channels

  • Mention or reply to the bot to start chatting or set up autonomous responses for natural conversation flow.
  • Decide in which channel the bot should use a selected prompt style.
  • Admin controls for all important settings.

image/png

📱 Direct Messages

  • Full DM support with all features.
  • Decide which server's settings to use in DMs.
  • Optional auto check-up messages sent by the bot when you're inactive with /dm_toggle.
  • Full conversation history loading with /dm_history_toggle.
  • Edit and regenerate bot responses with /dm_edit_last and /dm_regenerate.

image/png

🎪 Fun Interactive Commands

  • /kiss - Give the bot a kiss and see how they react! 💋
  • /hug - Warm hugs with personality-based responses. 🤗
  • /joke - Ask for jokes that match the bot's character. 😄
  • /bonk - Playfully bonk the bot's head. 🔨
  • /bite - Chomp! See how they handle it. 🧛
  • /affection - Find out how much the bot likes you based on your chat history. 💕

image/png

🧠 Memory & Context System

📚 Lore System

Add new lore entries with /lore_add.

  • Server Mode - Add character information about server members.
  • DM Mode - Add personal information about yourself for better roleplay.
  • Context-Aware - Automatically switches between server and personal lore.

🧠 Memory Bank

Create memories in DMs and servers, either automatically or manually.

  • Auto-generated Memories - Bot creates summaries of important conversations with /memory_generate.
  • Manual Memory Saving - Save specific moments or information manually with /memory_save.
  • Smart Recall - Bot remembers relevant details when topics come up.
  • Separate Storage - Server and DM memories are kept separately.

⚙️ Advanced Configuration

🤖 AI Model Management

  • Switch between different AI providers per server on the fly.
  • Adjust creativity levels (temperature settings) with /temperature_set.
  • Real-time provider status checking with /model_info.

🛠️ Utility Features

  • Clear conversation history with /clear.
  • Delete bot messages in bulk with /delete_messages
  • Set custom bot activities and status with /status_set and /activity.
  • Change bot nickname and avatar (admin only) with /bot_avatar_set and /bot_name_set.

📊 Admin Controls

👑 Server Management

  • Administrator-only configuration commands.
  • DM enable/disable for server members with /dm_enable.

🔒 Privacy Features

  • No conversation logging to files.
  • Optional DM functionalities.
  • User-controlled data settings.

🚀 Getting Started

  • Invite the bot to your server.
  • Mention the bot (@botname) to start chatting.
  • Use /help to see all available commands.
  • Set up your preferences with /model_set, /personality_create, and /prompt_set.
  • Have fun!

💝 Support the Developer

Enjoying the bot? Consider supporting the creator! Every donation helps!

Details

Commercial Use

If you want to discuss commercial use or something, hit me up first. That would be very kind of you, thank you!

Contact

Discord: marinara_spaghetti E-mail: mgrabower97@gmail.com

Credits

Special thanks to:

  • Claude Sonnet for fixing bugs and setting the groundwork.
  • Kuc0 for helping me with the setup scripts.
  • Heni for licensing help.
  • Crystal for her proxy.
  • Dottore for motivating me to finish this.
  • Rhy (and his crew), Xixicar, Akiki, Crow, Kiki, Shadow The Shagnus, Vynocchi, and Bun for testing the bots and supporting me.
  • My parents for not disinheriting me.
  • And you!

image/png