Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ A lightweight, secure, cloud-native ACP harness that bridges **Discord, Slack**,

## Quick Start

### Prerequisites

Before running openab, enable these in the [Discord Developer Portal](https://discord.com/developers/applications):

1. **Bot → Privileged Gateway Intents**:
- ✅ Message Content Intent
- ✅ Server Members Intent
2. **OAuth2 → URL Generator → Bot Permissions**:
- Send Messages, Embed Links, Attach Files
- Read Message History, Add Reactions

See [docs/discord.md](docs/discord.md) for a detailed step-by-step guide.

### 1. Create a Bot

<details>
Expand Down
21 changes: 20 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mod gateway;

use adapter::AdapterRouter;
use clap::Parser;
use serenity::gateway::GatewayError;
use serenity::prelude::*;
use std::collections::HashSet;
use std::path::PathBuf;
Expand Down Expand Up @@ -336,7 +337,25 @@ async fn main() -> anyhow::Result<()> {
});

info!("discord bot running");
client.start().await?;
match client.start().await {
Err(serenity::Error::Gateway(GatewayError::DisallowedGatewayIntents)) => {
error!(
"Discord rejected privileged intents. \
Enable MESSAGE CONTENT INTENT at: \
https://discord.com/developers/applications → Bot → Privileged Gateway Intents"
);
std::process::exit(1);
}
Err(serenity::Error::Gateway(GatewayError::InvalidAuthentication)) => {
error!(
"Discord rejected bot token. \
Verify your bot_token in config.toml is correct and has not been reset."
);
std::process::exit(1);
}
Err(e) => return Err(e.into()),
Ok(_) => {}
}
} else {
// No Discord — wait for SIGINT or SIGTERM
info!("running without discord, press ctrl+c to stop");
Expand Down
Loading