Robots Overview
Robots are automated integrations that connect to your Lag server. They can send and receive messages, monitor events, and react to activity in real time.
What Are Robots?
A robot is a programmatic agent that interacts with your server through the Lag API. Unlike regular users, robots authenticate with API keys instead of OAuth, and they operate through HTTP endpoints rather than WebSocket connections.
Robots are scoped to a single server. Each robot belongs to one server and can only access rooms and members within that server.
Capabilities
Robots can:
- Send messages to any room in the server
- Edit and delete their own messages
- Receive events when things happen in the server (messages, joins, leaves, voice activity)
- Read server state including member lists, room lists, and presence data
Robots cannot:
- Join voice rooms or transmit audio
- Create or delete rooms
- Manage server settings or members
- Access other servers
Use Cases
Moderation
Build a robot that monitors messages for prohibited content, automatically removes violations, and logs moderation actions.
Notifications
Connect external services to your server. A robot can post alerts from monitoring systems, CI/CD pipelines, or any service with webhook support.
Game Stats
Create a robot that pulls game statistics from an external API and posts updates when players achieve milestones or complete matches.
Welcome Messages
A robot can watch for member.join events and send a welcome message to a designated room with server rules and useful links.
Custom Commands
Build a robot that listens for messages starting with a prefix (like !) and responds with information, performs lookups, or triggers external actions.
Limits
- 10 robots per server - Each server can have at most 10 active robots
- Rate limits - Robots are rate-limited to 100 requests per minute globally and 10 messages per 10 seconds
- Message size - Robot messages follow the same size limits as user messages
How Robots Differ from Users
| Aspect | User | Robot |
|---|---|---|
| Authentication | OAuth (Discord/Google) | API key |
| Connection | WebSocket + HTTP | HTTP only |
| Voice | Can join voice rooms | No voice access |
| Scope | All joined servers | Single server |
| Creation | Self-registration | Created by server owner |
| Identity | Avatar + display name | Name + robot indicator |
Getting Started
- Navigate to the Robot Management Portal
- Select your server
- Create a new robot with your desired permissions
- Use the API key to authenticate requests
- Choose a transport type for receiving events
Continue to Creating Robots for a step-by-step walkthrough.