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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "22"
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint and format
run: yarn biome:ci

- name: Typecheck
run: yarn typecheck

- name: Build (static export)
env:
NEXT_TELEMETRY_DISABLED: "1"
run: yarn build
31 changes: 31 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PR title

# Squash merges use the PR title as the commit on main, so every PR title must be a
# Conventional Commit (same rule as doubt-bot).
on:
pull_request:
types: [opened, edited, reopened, synchronize]

permissions:
pull-requests: read

jobs:
conventional:
runs-on: ubuntu-24.04
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
perf
refactor
docs
test
build
ci
chore
revert
requireScope: false
29 changes: 29 additions & 0 deletions .github/workflows/secret-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Secret scan

on:
push:
pull_request:

permissions:
contents: read

jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# The gitleaks CLI is used directly: gitleaks-action needs a licence key on organisation repos.
# Pinned to the sha256 from the release's gitleaks_8.30.1_checksums.txt.
- name: Install gitleaks
env:
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
run: |
curl -sSfL -o gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz
echo "$GITLEAKS_SHA256 gitleaks.tar.gz" | sha256sum -c -
tar xzf gitleaks.tar.gz gitleaks

- name: Scan full history
run: ./gitleaks git --redact --no-banner --verbose
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# dependencies
node_modules

# next.js
.next
out
next-env.d.ts
*.tsbuildinfo

# env
.env
.env.local
.env*.local

# misc
.DS_Store
.vercel
.vscode
11 changes: 11 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default gitleaks rules, plus one narrow exception.
[extend]
useDefault = true

# The production Discord application (client) ID is public: it is part of every invite link.
# Allow only this exact value, only for the discord-client-id rule.
[[allowlists]]
description = "Public Doubt application ID (invite link)"
targetRules = ["discord-client-id"]
regexTarget = "secret"
regexes = ['''^941052587837378570$''']
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# doubt-docs

Documentation for [Doubt](https://doubtbot.eu), served at https://docs.doubtbot.eu.
Documentation for [Doubt](https://doubtbot.eu), served at **https://docs.doubtbot.eu**. Next.js 16 with MDX, exported as a static site and hosted on Vercel. Same colours and fonts as [doubt-site](https://github.com/Doubt-Productions/doubt-site).

## Run it

```bash
yarn install
yarn dev # http://localhost:3000
yarn build # static export to out/
yarn biome:fix # lint and format
yarn typecheck
```

## Content

Every page is `app/(docs)/<path>/page.mdx`. A new page also needs an entry in `lib/nav.ts`: the sidebar, search, sitemap and footer all read that list.

| URL | Page |
| ------------------------ | ------------------------------------------------------------------------------------ |
| `/` | Introduction |
| `/getting-started` | Add Doubt to your server |
| `/dashboard` | Dashboard |
| `/features/*` | moderation, automod, tickets, welcome, levelling, economy, utility, reports, premium |
| `/reference/commands` | Command list (generated, see below) |
| `/reference/permissions` | Permissions |
| `/security` | Security and data |
| `/faq` | FAQ |

MDX pages can use `<Callout type="note|tip|warning|premium">`, `<Steps>` around a numbered list, `<CommandList category="…" prefix="/…" />` and `<ContextMenuList />`. `##` and `###` headings get anchors and show up in the table of contents and search.

Privacy and terms live on doubtbot.eu (`/privacy`, `/terms`); the docs link there instead of keeping a copy.

## Command list

`data/commands.json` is generated from the bot's own discordx metadata, so the docs match what Discord shows. After a command changes in doubt-bot, regenerate it from a doubt-bot checkout next to this one:

```bash
cd ../doubt-bot
yarn install --frozen-lockfile && yarn prisma:generate
npx tsx ../doubt-docs/scripts/export-commands.mts ../doubt-docs/data/commands.json
```

It only imports the command files (nothing connects to Discord or the database). Staff-only commands are left out.

## Redirects

`vercel.json` sends the old Mintlify paths (`/introduction`, `/guides/commands`, `/legal/privacy`, …) to their new pages. Old `doubtbot.eu/docs/*` links are redirected to this site by doubt-site.

## Pull requests

PR titles are Conventional Commits (`docs:`, `feat:`, `fix:`, …), checked by `pr-title.yml`. CI runs Biome, the type check and the build; a separate workflow scans for secrets.
45 changes: 45 additions & 0 deletions app/(docs)/dashboard/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
export const metadata = {
title: 'Dashboard',
description: 'Sign in, who sees what, and every dashboard page.',
};

# Dashboard

The dashboard at [dash.doubtbot.eu](https://dash.doubtbot.eu) has the same settings as `/setup`, plus cases, transcripts and stats, in your browser.

## Signing in

Press **Sign in with Discord**. Discord asks to share your username, avatar and the list of servers you're in, so the dashboard can show the servers you manage. Doubt never gets your password.

On the sign-in page there is an unticked box, **Also join the Doubt support server**. Only if you tick it does Discord ask for permission to add you to the support server, and Doubt adds you once. It never adds anyone on its own.

## Who sees what

Access is checked against your **live** permissions in each server, every time you open a page:

| Your permission in the server | What you see |
|---|---|
| **Manage Server** or **Administrator** | Everything: overview, settings, cases, transcripts, stats and the Premium pages. |
| **Timeout Members** | The overview and **Cases**, read-only. |
| Neither | The server isn't listed. |

Being part of Doubt's own staff gives no access to any server's dashboard: staff see a server's settings, cases or transcripts only if their own roles in that server allow it.

## Pages

| Page | What it does |
|---|---|
| **All servers** | Your servers, with Doubt added or not. Servers without Doubt get an **Add Doubt** button. |
| **Overview** | Which features are on, recent cases and the top members by XP. |
| **Cases** | Every case, newest first, with a filter per member. |
| **Transcripts** | Closed tickets, with each transcript to read in the browser or delete. |
| **Stats** 💎 | Tickets opened and closed, time to close, cases per action and top moderators, over 30 or 90 days, and a CSV export of every case. |
| **Settings** | **Welcome**, **Tickets**, **Moderation** and **Levelling**, the same as `/setup`, with channel, role and emoji pickers. |
| **Bot look** 💎 | Upload Doubt's avatar and banner for the server and set its bio. |
| **Scheduled** 💎 | Create, pause and delete scheduled messages. |

Pages marked 💎 need [server Premium](/features/premium) to change anything; resetting the bot look and deleting schedules always work.

## Rules the dashboard follows

The dashboard can't do more than you could in Discord. A role you pick must pass the same [role safety rules](/features/welcome#roles-doubt-may-give), and a channel where Doubt will post your text (welcome, level-ups, the ticket panel) must be one you can post in yourself.
46 changes: 46 additions & 0 deletions app/(docs)/faq/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export const metadata = {
title: 'FAQ',
description: 'Common problems and how to fix them.',
};

# FAQ

## I don't see Doubt's commands

Discord can take a moment to show a new bot's commands. Restart Discord (or press `Ctrl R`). If a command still doesn't show, an admin may have hidden it in **Server Settings → Integrations → Doubt**, or you don't have the permission it needs by default (see the [command list](/reference/commands)).

## Doubt says it's missing a permission

It names the permission and the channel. Add it to Doubt's role, or remove the channel override that denies it. See [Permissions](/reference/permissions).

## Doubt can't give a role, or can't moderate someone

Doubt's highest role has to be above that role or member. Drag Doubt's role higher in **Server Settings → Roles**. Doubt also refuses roles with dangerous permissions; see [Roles Doubt may give](/features/welcome#roles-doubt-may-give).

## `/automod` says it needs Manage Server

Discord only lets bots edit AutoMod rules with **Manage Server**. Give Doubt's role that permission. See [AutoMod](/features/automod).

## The welcome message doesn't appear

Check that a welcome channel is set in `/setup` → **Welcome**, and that Doubt can **View Channel** and **Send Messages** there. Use **Send test** to try it.

## Members aren't getting XP

Levelling may be off in `/setup` → **Levelling**, the channel may be a no-XP channel, or the member already earned XP in the last minute.

## Transcripts don't show what members wrote

Discord only gives verified bots the text of messages after approving their **Message Content** access. Until then, transcripts show who posted when, with attachments and embeds. See [Tickets](/features/tickets#transcripts).

## A member can't open a ticket

They may already have a ticket open (one at a time), or the ticket category is missing or Doubt lacks **Manage Channels** and **Manage Roles** on it.

## I removed Doubt by accident

Add it again within 30 days and everything is still there. After that, the server's data is deleted.

## How do I contact Doubt?

Join the [support server](https://doubtbot.eu/support) or email [contact@doubtbot.eu](mailto:contact@doubtbot.eu).
38 changes: 38 additions & 0 deletions app/(docs)/features/automod/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export const metadata = {
title: 'AutoMod',
description: "Discord's own AutoMod rules, managed and logged by Doubt.",
};

# AutoMod

Doubt doesn't run its own filter. It sets up **Discord's native AutoMod rules** for you, so messages are blocked by Discord itself, instantly, even if Doubt is offline. Doubt then logs every hit to a channel you choose.

All `/automod` commands need **Manage Server**.

<Callout type="warning">
Discord only lets a bot edit AutoMod rules when it has **Manage Server** itself, and Doubt's invite doesn't ask for that permission. To use `/automod`, give Doubt's role **Manage Server** in **Server Settings → Roles**. Doubt tells you when it's missing.
</Callout>

## Protections

| Command | What it blocks |
|---|---|
| `/automod spam enabled` | Messages Discord flags as spam. |
| `/automod invites enabled` | Invite links to other Discord servers. |
| `/automod mentions limit` | Messages with more than `limit` mentions (3 to 50). `0` turns it off. |
| `/automod filter level` | Discord's own word lists: off, slurs, slurs and sexual content, or all three lists including swearing. |
| `/automod words add words` | Your own blocked words, comma-separated. Use `*` as a wildcard: `*scam*` matches any word containing "scam". |
| `/automod words remove words` | Unblock words again. |
| `/automod words list` | Show your blocked words. |

`/automod status` shows which protections are on, where hits are logged, and any other AutoMod rules your server has that Doubt doesn't manage.

<Callout>
Doubt recognises its own rules by their name and by Doubt being their creator. Rules you made yourself in **Server Settings → AutoMod** keep working, and Doubt never changes them.
</Callout>

## Hit log

`/automod log channel` picks where hits are posted; leave `channel` empty to stop logging. You can also set it in `/setup` → **Moderation**. Each log entry shows the member, the rule, the action Discord took (block or timeout) and the keyword that matched. Doubt never stores or posts the rest of the message.

<CommandList category="Moderation" prefix="/automod" />
23 changes: 23 additions & 0 deletions app/(docs)/features/economy/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const metadata = {
title: 'Economy',
description: 'Wallet, bank, begging and top.gg vote rewards.',
};

# Economy

A simple coin economy, separate in every server: a wallet, a bank and a few ways to earn.

- `/economy` creates your account in this server, or deletes it again.
- `/bal` shows your wallet, bank and total.
- `/beg` wins or loses 10 to 310 coins, once a minute.
- `/deposit amount` and `/withdraw amount` move coins between wallet and bank. Use `all` to move everything.

## Vote rewards

Voting for Doubt on top.gg pays **250 coins** into the wallet of every economy account you have, **doubled on weekends**. You can vote again every 12 hours, and Doubt sends you a thank-you DM if your DMs are open.

<Callout>
Coins have no value outside Doubt and can't be bought, sold or traded for anything real.
</Callout>

<CommandList category="Economy" />
49 changes: 49 additions & 0 deletions app/(docs)/features/levelling/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
export const metadata = {
title: 'Levelling',
description: 'XP, rank cards, level-up messages and reward roles.',
};

# Levelling

Members earn XP for chatting and level up over time. Levelling is on in every server unless you turn it off in `/setup` → **Levelling**.

## How XP works

- One message a minute per member earns **15 to 25 XP**. Messages in between earn nothing, so spamming doesn't help.
- Going from level `L` to the next level costs `5L² + 50L + 100` XP. Reaching level 1 takes 100 XP; going from level 9 to 10 takes 955 XP, and each level after that costs a little more.
- Doubt only notes who sent a message and where. It never reads or stores the text for levelling.

## Rank cards and leaderboard

- `/rank info` shows your rank card (or someone else's with `user`): level, XP into the level, progress bar and rank in the server.
- `/rank leaderboard` shows the members with the most XP.

## Level-up messages

Pick where they go in `/setup` → **Levelling**: **where they chatted**, **in one channel**, or off. The default message is:

> 🎉 @member reached level **5**!

Placeholders: `{user}` (a mention), `{username}`, `{level}` and `{server}`.

## Reward roles

`/rank reward add level role` gives a role when a member reaches that level; `/rank reward remove level` stops it. A server can have **25** reward roles, or **100** with Premium. Reward roles follow the same [safety rules](/features/welcome#roles-doubt-may-give) as welcome roles.

## Changing someone's level

`/rank set user level` and `/rank reset user` change or clear a member's level. Both need **Manage Server**.

## Premium extras

<Callout type="premium" title="💎 Server Premium: XP boosts and more rewards">
In `/setup` → **Levelling** → **XP boosts** (or on the dashboard), give roles and channels or categories a multiplier from 1.1× to 3×, up to 25 of each, and pick up to 25 channels or categories where messages earn no XP. A message earns the member's best role boost times the best channel boost, capped at 3×. Servers with Premium can also have 100 reward roles.
</Callout>

<Callout type="premium" title="💎 User Premium: your own rank card">
`/rank style` picks one of eight backgrounds, an accent colour and a bar colour for your rank card, in every server. `/rank style reset:true` goes back to the standard card.
</Callout>

If Premium ends, boosts and styles are kept but not used until it's back, and only the 25 lowest-level rewards are given.

<CommandList category="Levelling" />
Loading
Loading