GuildScript Documentation

Everything you need to run GuildScript in your server: command reference, plan limits, and a complete guide to writing agents.

Documentation

Scripting Guide

Vibe Coding with AI Agents

How to get AI tools to write working GuildScript agents: what to ask for, what context to provide, and how to fix scripts that do not work.

Lesson 1: Your First Agent

From an empty file to a running agent: the anatomy of an agent, how to upload it, and how to test it.

Lesson 2: Events and Payloads

The 15 events agents can subscribe to, the exact payload shape each one delivers, and how to pick the right one.

Lesson 3: Working with Messages

Reading message content, mentions, and attachments, and acting on messages: reply, react, edit, delete, pin, and bulk operations.

Lesson 4: Members, Roles, and Moderation

Reading member data, assigning roles, sending DMs, and the moderation toolkit: timeout, kick, and ban.

Lesson 5: Channels, Threads, and the Server

Fetching and creating channels, editing channel settings, threads, invites, webhooks, and server-level management.

Lesson 6: Embeds and the discord Module

Importing from the built-in discord module, building embeds, using formatters, and the enums you will reach for most.

Lesson 7: Buttons and Interactions

Posting buttons from one agent and handling clicks in another: the interactionCreate event, custom IDs, and reply modes.

Lesson 8: Select Menus and Modals

Dropdown menus for choices and modal forms for free-text input, plus how to read what the user picked or typed.

Lesson 9: Storing Data with db

Connecting your MongoDB Atlas cluster and using the db helper: insert, find, update, delete, and upserts.

Lesson 10: Database Patterns

Battle-tested shapes for common features: leaderboards, cooldowns, per-server settings, and one-time flags.

Lesson 11: AI in Your Agents (llm)

Connecting Groq, Mistral, or Gemini and calling models from agents with llm.chat: options, limits, and patterns.

Lesson 12: Error Handling, Limits, and Performance

How failures surface in GuildScript, the limits every run lives under, and how to write agents that behave well at the edges.

Lesson 13: Advanced Patterns

Multi-agent features, reaction roles, audit log monitors, webhook loggers, and conventions that keep big setups maintainable.

Differences from discord.js

What carries over from discord.js, what is intentionally different, and a migration mapping for developers who know the library.