Skip to content

About

Vencord plugin that auto-replies to Discord DMs from selected friends using a local or cloud AI (OpenAI, Anthropic, Groq, Ollama, LM Studio, ...). Educational use only.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AIAutoReply

A Vencord plugin that auto-replies to Discord DMs from friends you choose, using a local or cloud AI model. Pick who it answers for, give it a personality, and it handles the conversation.

Works with any OpenAI-compatible API (OpenAI, Groq, Ollama, LM Studio, OpenRouter, Together, Mistral, …) and Anthropic (Claude) natively.


⚠️ Disclaimer — read this first

This project is provided for educational purposes only.

  • Automating actions on a normal Discord user account (a "self-bot") is against Discord's Terms of Service and can result in your account being suspended or banned.
  • This software is provided "as is", without warranty of any kind, express or implied. You use it entirely at your own risk.
  • You alone are solely responsible for how you use it and for any consequences. The author and contributors accept no liability for any account action, damages, or misuse — by you or by anyone else who obtains this code.
  • This tool is not affiliated with or endorsed by Discord.
  • Be decent: only use it with people who know they may be talking to an AI. Don't use it to deceive, harass, spam, or impersonate.

By downloading, building, or using this software you accept full responsibility for your own actions.

Messages from enabled DMs are sent to whichever AI provider you configure (e.g. OpenAI, Anthropic, Groq) for processing. If you don't want your messages leaving your machine, use a local model (Ollama / LM Studio).


Features

  • 🎯 Per-DM control — a toggle button in the chat bar turns auto-reply on/off for the specific person you're DMing. Off for everyone by default; enable as many individual DMs as you like.
  • 🧠 Any model, local or cloud — one OpenAI-compatible slot covers OpenAI, Groq, Ollama, LM Studio, OpenRouter, and more; plus native Anthropic/Claude support.
  • 🎭 Layered personas — a global base instruction that always applies, plus optional per-friend instructions stacked on top (be a pirate to one friend, formal to another).
  • 🔎 Searchable friend picker in settings, with per-friend instruction boxes.
  • ⚡ Instant replies — no fake typing delay; the reply is sent as soon as the model responds.
  • 🛡️ Safe by design — never replies to your own messages, never double-replies to the same message, and fails silently on API errors (no crashes).

How it works

A friend you enabled DMs you
  → the plugin hears Discord's MESSAGE_CREATE event
  → checks: is this a DM? is this person enabled? not me / not a bot?
  → grabs the last ~15 messages for context
  → builds a prompt: [global instruction] + [this friend's instructions]
  → calls your chosen AI provider
  → sends the reply back into the DM

AI requests are made from Electron's main process (via a small native module) so they aren't blocked by the browser's CORS policy — that's why cloud APIs like OpenAI/Anthropic work directly.


Requirements

  • A source install of Vencord (custom plugins must be compiled into Vencord — you can't drop them into the installer build as loose files). See the Vencord plugin docs.
  • Node.js (v18+) and pnpm
  • An AI provider: a cloud API key or a local server like Ollama / LM Studio

Installation

You need a source build of Vencord. Pick one of the two ways to add the plugin.

Option A — Quick (grab the release zip)

  1. Get Vencord's source if you don't have it:
    git clone https://github.com/Vendicated/Vencord
    cd Vencord && pnpm install
  2. Download aiAutoReply.zip from the latest release and unzip it into src/userplugins/, so you end up with:
    Vencord/src/userplugins/aiAutoReply/index.tsx
    
  3. Build and inject:
    pnpm build
    pnpm inject      # pick your Discord/Vesktop install when prompted

Option B — From source (clone + sync, for tinkering)

This repo keeps the testable core (src/core/) and the Vencord glue (plugin/) separate, so it isn't a drop-in folder by itself — scripts/sync.mjs assembles them.

git clone https://github.com/Nitro70/AIAutoReply
cd AIAutoReply && pnpm install
# copy the assembled plugin into your Vencord clone
# (defaults to ../Vencord; override the destination with VENCORD_USERPLUGIN)
node scripts/sync.mjs
# then build Vencord
cd ../Vencord && pnpm build && pnpm inject

After either option, fully restart Discord and enable AIAutoReply in Settings → Vencord → Plugins.

First launch needs a full restart (not just Ctrl+R), because the plugin loads a native module in Discord's main process. After that, code changes to the UI/logic hot-reload with Ctrl+R; only changes to the native module need another restart.


Configuration

Open the plugin's settings (the cog next to it in the Plugins list).

Provider & base URL

Choose OpenAI-compatible or Anthropic, then set the base URL. Leave the base URL blank to use the provider's default.

Provider Provider setting Base URL Example model
OpenAI OpenAI-compatible https://api.openai.com/v1 (or blank) gpt-4o-mini
Groq OpenAI-compatible https://api.groq.com/openai/v1 llama-3.3-70b-versatile
Ollama (local) OpenAI-compatible http://localhost:11434/v1 llama3
LM Studio (local) OpenAI-compatible http://localhost:1234/v1 (whatever you loaded)
OpenRouter OpenAI-compatible https://openrouter.ai/api/v1 meta-llama/llama-3.1-8b-instruct
Together OpenAI-compatible https://api.together.xyz/v1 meta-llama/Llama-3.3-70B-Instruct-Turbo
Mistral OpenAI-compatible https://api.mistral.ai/v1 mistral-small-latest
Anthropic Anthropic (blank → https://api.anthropic.com) claude-3-5-sonnet-20241022

Model names change over time — check your provider's docs for the current list (e.g. Groq: https://console.groq.com/docs/models).

Other settings

  • Model — the exact model ID for your provider (see table).
  • API key — your provider key. Leave blank for local/no-key servers (Ollama, LM Studio).
  • Max tokens — maximum length of the reply (default 512).
  • Global instruction — the base persona/rules, always applied.
  • Friends — search and add friends, each with an optional per-friend instruction.

Personas (the layered instruction system)

Every reply uses the global instruction, plus that friend's per-friend instruction (if set), stacked on top. Example global instruction:

You are replying on my behalf in a Discord DM. Reply naturally and briefly to
any message as if you were me.

Want it to sound like JARVIS from Iron Man? Drop this in the global instruction (or a per-friend box):

Reply to my Discord DMs as JARVIS from Iron Man: polished British wit, dry humor,
unfailingly calm and polite, concise and efficient. Stay in character, keep it to
a sentence or two, never reveal you're an AI.

Usage

  1. Open a DM with a friend.
  2. Click the 🤖 chat-bar button (next to the message box). Bright = auto-reply ON for this person; dimmed = OFF.
  3. That's it — when they message you, the AI replies automatically.
  4. Repeat in any other DMs you want handled. Everyone is off by default.

You can also add/remove people and edit their personas from the plugin settings. The settings list and the per-DM toggle are the same set — a person is in the list ⇔ auto-reply is on for them.

Heads up: toggling a person off removes them from the list, which also clears any custom instruction you set for them.


Updating the plugin

After pulling changes (or editing the code), rebuild Vencord:

cd Vencord
pnpm build      # then Ctrl+R in Discord (or restart if native.ts changed)

Development

This repo is structured so the core logic is testable without running Discord:

src/core/      Pure, framework-free TypeScript (unit-tested with vitest)
  types.ts       shared types
  guards.ts      the "should we reply?" decision
  context.ts     builds the prompt + message history
  openai.ts      OpenAI-compatible request/response
  anthropic.ts   Anthropic request/response
  chat.ts        provider dispatch (transport injected for testing)
plugin/        Vencord glue (compiled inside Vencord)
  index.tsx      plugin definition (settings, flux handler, chat-bar button)
  settings.ts    settings schema + handled-friends persistence
  native.ts      main-process HTTP POST (CORS bypass)
  request.ts     renderer → native bridge
  handler.ts     MESSAGE_CREATE orchestration
  ui/            chat-bar toggle + friend manager components
scripts/sync.mjs Copies src/core + plugin into a Vencord userplugin folder

Run the unit tests:

pnpm install
pnpm test          # vitest

If you keep this repo separate from your Vencord clone, scripts/sync.mjs copies the source into ../Vencord/src/userplugins/aiAutoReply (override with the VENCORD_USERPLUGIN env var).


Scope & limitations (v1)

  • DMs only — no group DMs, no server channels, no @mention handling.
  • Fully automatic — there's no "draft and approve" mode; enabled DMs send on their own.
  • Instant — no typing indicator or human-like delay.
  • Context window is the last ~15 messages; reply length capped by Max tokens.

License

GPL-3.0-or-later. This plugin builds on and is intended for use with Vencord (also GPL-3.0). Vencord is not affiliated with this project.

Credits

About

Vencord plugin that auto-replies to Discord DMs from selected friends using a local or cloud AI (OpenAI, Anthropic, Groq, Ollama, LM Studio, ...). Educational use only.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages