diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4db14cb --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..7ed108a --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -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 diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml new file mode 100644 index 0000000..657d8e6 --- /dev/null +++ b/.github/workflows/secret-scan.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..405f84b --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.gitleaks.toml b/.gitleaks.toml new file mode 100644 index 0000000..c02c422 --- /dev/null +++ b/.gitleaks.toml @@ -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$'''] diff --git a/README.md b/README.md index 464c69a..0e8d0d4 100644 --- a/README.md +++ b/README.md @@ -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)//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 ``, `` around a numbered list, `` and ``. `##` 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. diff --git a/app/(docs)/dashboard/page.mdx b/app/(docs)/dashboard/page.mdx new file mode 100644 index 0000000..bc1a888 --- /dev/null +++ b/app/(docs)/dashboard/page.mdx @@ -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. diff --git a/app/(docs)/faq/page.mdx b/app/(docs)/faq/page.mdx new file mode 100644 index 0000000..8cbba6e --- /dev/null +++ b/app/(docs)/faq/page.mdx @@ -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). diff --git a/app/(docs)/features/automod/page.mdx b/app/(docs)/features/automod/page.mdx new file mode 100644 index 0000000..bb3aee4 --- /dev/null +++ b/app/(docs)/features/automod/page.mdx @@ -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**. + + +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. + + +## 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. + + +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. + + +## 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. + + diff --git a/app/(docs)/features/economy/page.mdx b/app/(docs)/features/economy/page.mdx new file mode 100644 index 0000000..87cb419 --- /dev/null +++ b/app/(docs)/features/economy/page.mdx @@ -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. + + +Coins have no value outside Doubt and can't be bought, sold or traded for anything real. + + + diff --git a/app/(docs)/features/levelling/page.mdx b/app/(docs)/features/levelling/page.mdx new file mode 100644 index 0000000..b8e30c5 --- /dev/null +++ b/app/(docs)/features/levelling/page.mdx @@ -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 + + +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. + + + +`/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. + + +If Premium ends, boosts and styles are kept but not used until it's back, and only the 25 lowest-level rewards are given. + + diff --git a/app/(docs)/features/moderation/page.mdx b/app/(docs)/features/moderation/page.mdx new file mode 100644 index 0000000..2db6e49 --- /dev/null +++ b/app/(docs)/features/moderation/page.mdx @@ -0,0 +1,47 @@ +export const metadata = { + title: 'Moderation and cases', + description: 'Warn, timeout, kick and ban, with numbered cases and a mod log.', +}; + +# Moderation and cases + +Every moderation action Doubt takes is saved as a numbered **case** for your server, so you can look up what happened to a member, who did it and why. + +## Actions + +| Command | What it does | Default permission | +|---|---|---| +| `/warn member reason` | Records a warning. Nothing else happens to the member. | Timeout Members | +| `/timeout member duration reason` | Times the member out, up to 28 days (`30m`, `2h`, `3d`). | Timeout Members | +| `/untimeout member reason` | Lifts a timeout early. | Timeout Members | +| `/kick member reason` | Kicks the member. | Kick Members | +| `/ban user duration delete_messages reason` | Bans for good, or for a while with `duration` (`7d`, `2w`). Works with a user ID for people who already left. `delete_messages` removes their last hour, day or week of messages. | Ban Members | +| `/unban user reason` | Unbans by user ID. | Ban Members | + +The reason is shown to the member (in the DM), in the case and in Discord's audit log. + +Doubt refuses an action it shouldn't take: on the server owner, on yourself, on Doubt, or on someone whose highest role is the same as or above yours (unless you own the server) or Doubt's. + +### Temporary bans + +A ban with a `duration` is lifted automatically when it ends, and the unban is recorded as its own case. Bans and unbans done through Discord itself (right-click → Ban) are recorded as cases too. + +### DMs to the member + +With **DM on action** turned on (the default), Doubt messages the member before a warn, timeout, kick or ban, with the server name, the action and the reason. Kicks and bans are DMed first, because afterwards Doubt shares no server with them. If their DMs are closed, the action still happens and the case says the DM couldn't be sent. Turn it off in `/setup` → **Moderation** or on the dashboard. + +## Cases + +Cases are numbered per server: #1, #2, #3 and so on. + +- `/case view number` shows one case. +- `/case history member` lists a member's cases. The **Cases** context menu (right-click a member → Apps → Cases) does the same. +- `/case reason number reason` changes a case's reason. Only the moderator who made the case, or someone with **Manage Server**, can edit it. The mod log message is updated too. + +On the [dashboard](/dashboard), the **Cases** page lists every case with a filter per member. Members with **Timeout Members** can read cases there; changing settings needs **Manage Server**. + +## Mod log + +Pick a **mod log** channel in `/setup` → **Moderation** and every new case is posted there as it happens, with the member, moderator, reason and duration. Doubt needs **View Channel**, **Send Messages** and **Embed Links** in that channel. + + diff --git a/app/(docs)/features/premium/page.mdx b/app/(docs)/features/premium/page.mdx new file mode 100644 index 0000000..aad9416 --- /dev/null +++ b/app/(docs)/features/premium/page.mdx @@ -0,0 +1,55 @@ +export const metadata = { + title: 'Premium', + description: 'What server and User Premium add, and how to get them.', +}; + +# Premium + +Doubt Premium comes in two kinds, both sold through Discord's own shop. Moderation, AutoMod, reports and tickets stay free for everyone. + +| | Server Premium | User Premium | +|---|---|---| +| **Who buys it** | A server admin, for one server | Anyone, for themselves | +| **How it's paid** | A monthly subscription | A one-time purchase | +| **Works in** | That server | Every server you share with Doubt | + +Server Premium gives the person who pays for it no User Premium perks, and the other way round. + +## Server Premium + +| Perk | What you get | +|---|---| +| **Custom bot look** | Doubt's own avatar, banner and About Me in your server: `/botlook avatar`, `/botlook banner`, `/botlook bio`, or the dashboard's **Bot look** page. | +| **Custom ticket topics** | Up to 10 ticket topics of your own, each with a name, emoji and staff role. See [Tickets](/features/tickets#topics). | +| **XP boosts** | More XP for chosen roles and channels, and channels with no XP. See [Levelling](/features/levelling#premium-extras). | +| **More level rewards** | Up to 100 level reward roles instead of 25. | +| **Scheduled messages** | Post embeds once or on repeat with `/schedule`. See [Utility](/features/utility#embed-creator). | +| **Dashboard stats** | Ticket and case trends over 30 or 90 days, and a CSV export of every case. | +| **Welcome image cards** | A picture card with the new member's avatar on every welcome message. | + +## User Premium + +| Perk | What you get | +|---|---| +| **Custom rank card** | Pick your rank card's background, colours and bar with `/rank style`, in every server. | +| **Profile flair** | An accent colour and a short bio line on your `/user info` and `/user profile`. | +| **Premium badge** | A 💎 Premium badge on your profile. | +| **Longer AFK messages** | AFK messages up to 500 characters instead of 200. | + +## Getting Premium + +Run `/premium` in your server. It shows what's active for you and for the server, with Discord's buy buttons for whatever isn't. You can also open Doubt's profile in Discord and go to its store, or read more on [doubtbot.eu/premium](https://doubtbot.eu/premium). + +Payments go through Discord: Doubt never sees or stores your payment details. Cancel a server subscription in Discord under **User Settings → Subscriptions**. + +## When Premium ends + +Nothing is deleted. Your custom topics, boosts, schedules, styles and flair are kept and come back when Premium does. While it's off: + +- Doubt goes back to its normal avatar, banner and bio in the server. +- The ticket panel shows the standard topics; open tickets keep working. +- Scheduled messages are paused, and only the 25 lowest-level reward roles are given. + + +If you are in [Doubt’s support server](https://doubtbot.eu/support), buying either kind of Premium gives you a supporter role there while your Premium lasts. + diff --git a/app/(docs)/features/reports/page.mdx b/app/(docs)/features/reports/page.mdx new file mode 100644 index 0000000..63048e3 --- /dev/null +++ b/app/(docs)/features/reports/page.mdx @@ -0,0 +1,24 @@ +export const metadata = { + title: 'Reports', + description: "Report a member, a message or a server to Doubt's staff.", +}; + +# Reports + +Reports go to **Doubt's own staff**, not to the server's moderators. Use them when someone misuses Doubt or breaks Discord's rules in a way the server itself can't or won't handle. For problems in your server, contact its moderators or open a ticket there. + +## How to report + +- `/report user user reason`: report a member. +- **Report message**: right-click a message → **Apps** → **Report message**, then describe what happened. Doubt includes the text of that message (up to 1,000 characters) with the report. +- `/report server reason`: report the server you're in for misusing Doubt. + +You can't report yourself or a bot, and you can send one report a minute. + +## What happens next + +Doubt's staff review each report and mark it resolved or dismissed. The person you reported is never told who reported them. Handled reports are deleted 30 days later. + + +In an emergency, or for anything that breaks Discord's own rules, also report it to Discord: right-click the message or user → **Report**, or use [Discord's report form](https://dis.gd/report). + diff --git a/app/(docs)/features/tickets/page.mdx b/app/(docs)/features/tickets/page.mdx new file mode 100644 index 0000000..049d7e5 --- /dev/null +++ b/app/(docs)/features/tickets/page.mdx @@ -0,0 +1,49 @@ +export const metadata = { + title: 'Tickets', + description: 'A ticket panel, private ticket channels and transcripts.', +}; + +# Tickets + +Members open a private ticket from a panel; Doubt creates a channel only they and your support team can see, and saves a transcript when it's closed. + +## Set it up + +In `/setup` → **Tickets** (or on the dashboard), pick: + +- **Category for new tickets:** where ticket channels are created. Doubt needs **Manage Channels** and **Manage Roles** on that category to set each ticket's permissions. +- **Channel for the ticket panel:** where the panel with the topic menu is posted. +- **Support role:** who sees and handles every ticket. +- **Ticket log and transcripts channel:** where closed tickets and their transcripts are posted. + +Then press **Post panel again** to post the panel. Do that again after you change the topics. + +## Topics + +The standard panel has three topics: **General support**, **Report a member** and **Appeal**. The topic is shown on the ticket and in the log. + + +With server Premium you can replace them with up to 10 topics of your own, each with a name, an emoji (a normal or server emoji), a short description and an optional staff role. That role sees and handles the tickets of its topic, next to the support role. Manage them in `/setup` → **Tickets** → **Custom topics** or on the dashboard. If Premium ends, your topics are kept and the panel shows the standard three until it's back. + + +## Working a ticket + +- A member can have **one open ticket** at a time. Ticket channels are numbered (`ticket-0007`) so names never show who opened them. +- **Claim** marks that you're handling it. **Close** closes it; the member who opened it can close their own ticket too. +- `/ticket add member` and `/ticket remove member` let someone else into the ticket, or take them out. +- `/ticket close reason` closes it with a reason. The channel is deleted a few seconds later. +- A ticket channel deleted by hand still counts as closed, so the member can open a new one. + +Support staff are the support role, the topic's own staff role, and anyone with **Manage Channels**. + +## Transcripts + +When a ticket closes, Doubt saves an HTML transcript of the channel (up to the last 5,000 messages) and posts it with a summary in the ticket log channel. On the [dashboard](/dashboard), the **Transcripts** page lists closed tickets and opens each transcript in your browser. Admins can delete a transcript there. + +Transcripts are deleted **30 days after the ticket closed**, together with the copy posted in the log channel. + + +Discord only gives bots the text of members' messages with its **Message Content** permission, which verified bots like Doubt have to apply for. Until Discord has approved it, transcripts show who posted when, plus attachments and embeds, and a note that the message text wasn't available. + + + diff --git a/app/(docs)/features/utility/page.mdx b/app/(docs)/features/utility/page.mdx new file mode 100644 index 0000000..d80f98a --- /dev/null +++ b/app/(docs)/features/utility/page.mdx @@ -0,0 +1,44 @@ +export const metadata = { + title: 'Utility', + description: 'AFK, server and user info, and the embed creator.', +}; + +# Utility + +## AFK + +`/afk set message` marks you as away in this server. When someone mentions you, Doubt replies with your message. The next time you send a message, Doubt removes your AFK and says welcome back. `/afk remove` clears it by hand. + +If Doubt has **Manage Nicknames**, it also puts `[AFK]` in front of your nickname and changes it back when you return. + +AFK messages can be up to 200 characters, or 500 with [User Premium](/features/premium). + +## Server and user info + +| Command | Shows | +|---|---| +| `/serverinfo` | Members, channels, roles, boosts, creation date and owner of the server. | +| `/user info user` | Account age, join date, roles and key permissions. Also on the **Info** context menu. | +| `/user avatar user` | An avatar in full size. Also on the **Get Avatar** context menu. | +| `/user profile user` | Doubt badges and profile. Also on the **Profile** context menu. | +| `/botinfo` | Doubt's version, uptime, server count and links. | +| `/ping` | Doubt's response time. | +| `/help` | Every command you can use, by category, with links to the docs and the privacy policy. | + +Context menus are on the right-click menu of a member (**Apps** on mobile). + +## Embed creator + +`/embedcreator` (needs **Manage Messages**) opens a form for a title, description, colour, footer and image. Doubt shows a private preview; when it looks right, pick a channel and post it. The embed is posted without pinging anyone, and only in channels where you can post yourself. + + +`/schedule create channel when repeat hours` posts an embed made with the same form later, once or on repeat: daily, weekly or every 1 to 720 hours. Times are in UTC (`2026-12-24 18:00`, a Discord timestamp, or `in 2h`), and repeats never drift. A server can have 25 schedules. `/schedule list` and `/schedule delete number` work without Premium; without Premium, schedules are kept but paused. A schedule also pauses itself when its channel is gone or Doubt or its creator can no longer post there. + + +## Profile flair + + +`/profile flair colour bio` sets an accent colour and a one-line bio (up to 100 characters, no links or mentions) shown on your `/user info` and `/user profile`. `/profile flair reset:true` removes it. + + + diff --git a/app/(docs)/features/welcome/page.mdx b/app/(docs)/features/welcome/page.mdx new file mode 100644 index 0000000..f3e9024 --- /dev/null +++ b/app/(docs)/features/welcome/page.mdx @@ -0,0 +1,48 @@ +export const metadata = { + title: 'Welcome and join roles', + description: 'Welcome messages, placeholders and roles for new members.', +}; + +# Welcome and join roles + +When someone joins, Doubt can post a welcome message and give them a role. Set it up in `/setup` → **Welcome** or on the dashboard's **Welcome** settings. + +## Settings + +| Setting | What it does | +|---|---| +| **Welcome channel** | Where the welcome message is posted. No channel means no message. | +| **Rules channel** | The channel `{rules}` links to. | +| **Role for new members** | Given to every person who joins. | +| **Role for new bots** | Given to bots that are added, instead of the member role. | +| **Message** | Your own welcome text, or the default. **Send test** posts it as if you just joined; **Reset message** goes back to the default. | + +The default message is: + +> 👋 Welcome to **Your Server**, @member! Have a look at #rules and enjoy your stay. You are member #1,234. + +## Placeholders + +| Placeholder | Becomes | +|---|---| +| `{user}` | A mention of the new member | +| `{username}` | Their username, without a ping | +| `{server}` | Your server's name | +| `{rules}` | A link to the rules channel (or "the rules" when none is set) | +| `{membercount}` | The member count after they joined | + +## Roles Doubt may give + +To keep a join role from becoming a back door, Doubt only gives roles that are safe: + +- The role must be below Doubt's highest role, and can't be `@everyone` or a role managed by an integration. +- It can't carry **Administrator**, **Manage Server**, **Manage Roles**, **Manage Channels**, **Manage Webhooks**, **Manage Messages**, **Ban Members**, **Kick Members**, **Timeout Members** or **Mention Everyone**. +- The person who picks it must be the owner, an Administrator, or have **Manage Roles** with the role below their own highest role. + +Doubt checks this again before each join, and skips a role that has become unsafe. The same rules apply to [level reward roles](/features/levelling). + +The welcome channel must also be one you can view and post in yourself: Doubt won't post your text in a channel you couldn't post in. + + +Turn on the **image card** to attach a picture to every welcome message, with the new member's avatar, name, your server's name and the member count. Doubt needs **Attach Files** in the welcome channel; without it the message is sent without the card. + diff --git a/app/(docs)/getting-started/page.mdx b/app/(docs)/getting-started/page.mdx new file mode 100644 index 0000000..c4e9649 --- /dev/null +++ b/app/(docs)/getting-started/page.mdx @@ -0,0 +1,42 @@ +export const metadata = { + title: 'Add Doubt to your server', + description: 'Invite Doubt, check its role and run /setup.', +}; + +# Add Doubt to your server + +Doubt is ready in a few minutes: invite it, move its role up, and pick what it should do with `/setup`. + + + +1. **Invite Doubt.** Open [doubtbot.eu/invite](https://doubtbot.eu/invite), pick your server and keep every permission ticked. You need **Manage Server** in that server to add a bot. The permissions are explained on the [permissions page](/reference/permissions). + +2. **Move Doubt's role up.** In **Server Settings → Roles**, drag the **Doubt** role above every role it should give out (welcome and level reward roles) and above the members it should moderate. Discord only lets a bot act on roles and members below its own highest role. + +3. **Run `/setup`.** It opens a private panel with four sections: **Welcome**, **Tickets**, **Moderation** and **Levelling**. Each one shows what's set and has buttons and menus to change it. Only you see the panel. You need **Manage Server**. + +4. **Try a command.** `/help` lists every command you can use. Moderators can try `/warn` on a test account and see the case appear in the mod log. + + + + +Everything in `/setup` is also on the [dashboard](https://dash.doubtbot.eu), with channel and role pickers. Use whichever you like; they change the same settings. + + +## What to set up first + +- **Moderation:** pick a **mod log** channel so every case is posted there, and choose whether members get a DM when they're warned, timed out, kicked or banned (on by default). See [Moderation and cases](/features/moderation). +- **AutoMod:** run `/automod status`, then turn on the protections you want, such as `/automod spam` and `/automod invites`. See [AutoMod](/features/automod). +- **Tickets:** pick a category for ticket channels, a channel for the panel, a support role and a log channel, then post the panel. See [Tickets](/features/tickets). +- **Welcome:** pick the welcome channel and message, and roles for new members and bots. See [Welcome and join roles](/features/welcome). +- **Levelling:** on by default. Choose where level-up messages go and add reward roles with `/rank reward add`. See [Levelling](/features/levelling). + +## Who can use which command + +Moderation commands carry Discord's own permission defaults: `/ban` needs **Ban Members**, `/timeout` needs **Timeout Members**, and so on. You can change who sees each command in **Server Settings → Integrations → Doubt**. Doubt still checks the member's real permissions when the command runs, so hiding or showing a command never gives anyone more power than their roles do. + +The [command list](/reference/commands) shows the default permission for every command. + +## Removing Doubt + +Kick Doubt from **Server Settings → Members** (or **Integrations**). It stops working there at once. Everything it stored for your server (settings, cases, tickets, transcripts, levels and balances) is deleted 30 days later, so an accidental kick loses nothing if you add it back in time. See [Security and data](/security). diff --git a/app/(docs)/layout.tsx b/app/(docs)/layout.tsx new file mode 100644 index 0000000..dfcabf7 --- /dev/null +++ b/app/(docs)/layout.tsx @@ -0,0 +1,5 @@ +import { DocsShell } from '@/components/docs-shell'; + +export default function DocsLayout({ children }: { children: React.ReactNode }) { + return {children}; +} diff --git a/app/(docs)/page.mdx b/app/(docs)/page.mdx new file mode 100644 index 0000000..0c120f2 --- /dev/null +++ b/app/(docs)/page.mdx @@ -0,0 +1,40 @@ +export const metadata = { + title: 'Introduction', + description: 'What Doubt does and where to start.', +}; + +

Doubt Docs

+ +# Your server, without a doubt. + +Doubt is a Discord bot for moderation with cases, Discord's own AutoMod, tickets with transcripts, welcome messages, levelling and a small economy. You set it up with `/setup` in Discord or on the [dashboard](https://dash.doubtbot.eu), and everything works with slash commands. + + + +## What Doubt does + +| Feature | In short | +|---|---| +| [Moderation and cases](/features/moderation) | `/warn`, `/timeout`, `/kick` and `/ban` (also temporary). Every action is a numbered case, with an optional mod log and a DM to the member. | +| [AutoMod](/features/automod) | Turns on Discord's native AutoMod rules for spam, invites, mass mentions and word lists, and logs every hit. | +| [Tickets](/features/tickets) | A panel members open private tickets from, with Claim and Close buttons and a saved transcript. | +| [Welcome and join roles](/features/welcome) | A welcome message with placeholders, and roles for new members and new bots. | +| [Levelling](/features/levelling) | XP for chatting, rank cards, a leaderboard, level-up messages and reward roles. | +| [Economy](/features/economy) | A wallet and bank per server, `/beg`, and coins for voting on top.gg. | +| [Utility](/features/utility) | AFK, server and user info, avatars and an embed creator. | +| [Reports](/features/reports) | Report a member, a message or a server to Doubt's own staff. | + +Moderation, AutoMod, reports and tickets are free for every server. [Premium](/features/premium) adds extras such as custom ticket topics, XP boosts, scheduled messages and a custom bot look. + +## Where to get help + +- **Support server:** [doubtbot.eu/support](https://doubtbot.eu/support) +- **Email:** [contact@doubtbot.eu](mailto:contact@doubtbot.eu) +- **Status:** [status.doubtbot.eu](https://status.doubtbot.eu) + +Run `/help` in Discord for the command list with links back to these docs. diff --git a/app/(docs)/reference/commands/page.mdx b/app/(docs)/reference/commands/page.mdx new file mode 100644 index 0000000..5a3125b --- /dev/null +++ b/app/(docs)/reference/commands/page.mdx @@ -0,0 +1,40 @@ +export const metadata = { + title: 'Commands', + description: 'Every command and context menu, with who can use it.', +}; + +# Commands + +Every Doubt command is a slash command: type `/` in Discord and pick it from the list. This list is generated from the bot itself, so it matches what you see in Discord. + +The label on the right is the permission a member needs by default. Server admins can change who sees each command in **Server Settings → Integrations → Doubt**; Doubt still checks the real permission when the command runs. **Everyone** means any member can use it. + +## Context menus + +Right-click a member or a message and open **Apps** (on mobile, long-press). + + + +## Moderation + + + +## Tickets + + + +## Setup + + + +## Levelling + + + +## Economy + + + +## Utility + + diff --git a/app/(docs)/reference/permissions/page.mdx b/app/(docs)/reference/permissions/page.mdx new file mode 100644 index 0000000..5dcaf17 --- /dev/null +++ b/app/(docs)/reference/permissions/page.mdx @@ -0,0 +1,45 @@ +export const metadata = { + title: 'Permissions', + description: 'What Doubt needs in your server, and why.', +}; + +# Permissions + +Doubt's invite link asks for these permissions. Keep them all ticked: each one is used by a feature, and Doubt asks for nothing it doesn't use. + +| Permission | Used for | +|---|---| +| **View Channels** | Seeing the channels it posts in and the ticket channels it creates. | +| **Send Messages** | Welcome, level-up, mod log and ticket messages, and command replies. | +| **Embed Links** | Every Doubt message is an embed. | +| **Attach Files** | Rank cards, welcome cards and ticket transcripts. | +| **Read Message History** | Saving ticket transcripts. | +| **Manage Messages** | Cleaning up messages in the channels Doubt manages. | +| **Manage Channels** | Creating and deleting ticket channels. | +| **Manage Roles** | Welcome and reward roles, and the permissions on each ticket channel. | +| **Kick Members** | `/kick` | +| **Ban Members** | `/ban` and `/unban`, and lifting temporary bans. | +| **Timeout Members** | `/timeout` and `/untimeout` | + +A few permissions aren't in the invite, because only one optional feature uses each: + +- **Manage Server** lets Doubt manage [AutoMod](/features/automod) rules. Add it to Doubt's role if you use `/automod`. +- **Manage Nicknames** lets Doubt put `[AFK]` in front of your nickname while you're [AFK](/features/utility#afk). Without it, AFK works the same, just without the tag. +- **Create Invite** is only used in Doubt's own support server. + +## Role order + +Discord lets a bot manage only the roles and members below its own highest role. Put Doubt's role: + +- above every role it should give (welcome and level reward roles), and +- above the members it should moderate. + +When something is missing, Doubt tells you which permission it lacks and where, instead of failing silently. + +## Channel overrides + +A channel can take a permission away again with an override. If Doubt can't post the welcome message, the mod log or the ticket panel, check that channel's **Permissions** tab for a deny on Doubt's role or `@everyone`. + +## Discord intents + +Doubt asks Discord for the **Server Members** intent (to welcome members and give join roles). It does not read members' messages: for levelling and AFK it only notes who posted where. Message text is only read to save ticket transcripts, and only while Discord has approved Doubt's **Message Content** access. Doubt has no prefix commands. diff --git a/app/(docs)/security/page.mdx b/app/(docs)/security/page.mdx new file mode 100644 index 0000000..15e996d --- /dev/null +++ b/app/(docs)/security/page.mdx @@ -0,0 +1,49 @@ +export const metadata = { + title: 'Security and data', + description: 'What Doubt stores, how long, and how access works.', +}; + +# Security and data + +This page explains in plain terms what Doubt keeps and who can see it. The [privacy policy](https://doubtbot.eu/privacy) and [terms](https://doubtbot.eu/terms) on doubtbot.eu are the binding versions. + +## What Doubt stores + +| Data | Why | Kept until | +|---|---|---| +| Server settings from `/setup` and the dashboard | So the features work | 30 days after Doubt leaves the server | +| Cases (member, moderator, action, reason, time) | Moderation history | 30 days after Doubt leaves the server | +| Tickets and their transcripts | Support history | Transcripts: 30 days after the ticket closed | +| AutoMod hits (member, rule, matched keyword) | The AutoMod log | 30 days after Doubt leaves the server | +| XP and levels | Levelling | 30 days after Doubt leaves the server | +| Economy accounts | The economy | Until you delete it with `/economy`, or 30 days after Doubt leaves the server | +| Your AFK message and the nickname to restore | AFK | Until you're back | +| Your Doubt profile: badges, rank card style, flair | Your profile and Premium perks | Until you reset them | +| Reports you send to Doubt's staff | Staff review | 30 days after they're handled | + +Doubt does **not** store message text for levelling, AFK or AutoMod, and it stores no payment details: Premium purchases are handled by Discord. Data is stored on a privately run server. + +## Who can see a server's data + +- **Your server's admins and moderators**, through Discord and the [dashboard](/dashboard), according to their permissions in your server. +- **Not Doubt's staff.** Doubt's own staff and developers get no access to any server's settings, cases, tickets or transcripts, unless their own roles in that server allow it. Staff tools only cover running the bot: the list of servers, blocking abusive users or servers, and handling reports. + +## How Doubt protects your server + +- **Every action is checked twice.** Discord's permission defaults decide who sees a command; Doubt then checks the member's real permissions and role order before acting. +- **Safe roles only.** Doubt won't hand out a role with dangerous permissions, or one above the person who picked it. See [Roles Doubt may give](/features/welcome#roles-doubt-may-give). +- **No posting where you can't.** Doubt only posts your text (welcome, level-up, embeds, the ticket panel) in channels you can post in yourself. +- **No pings from embeds.** Embeds made with `/embedcreator` and scheduled messages never ping anyone. +- **Native AutoMod.** Filtering runs in Discord itself, so it keeps working if Doubt is down. +- **Signed dashboard requests.** The dashboard talks to the bot over a private connection, and every request is signed and accepted only once. + +## Deleting your data + +- Remove Doubt from your server and its data for that server is deleted after 30 days. +- Admins can delete a ticket transcript on the dashboard at any time. +- `/economy` deletes your economy account; `/rank style reset:true` and `/profile flair reset:true` remove your styles. +- For anything else, email [contact@doubtbot.eu](mailto:contact@doubtbot.eu). + +## Reporting a security problem + +Found a way to misuse Doubt or see data you shouldn't? Email [contact@doubtbot.eu](mailto:contact@doubtbot.eu) with the details and please don't share it publicly until it's fixed. diff --git a/app/globals.css b/app/globals.css new file mode 100644 index 0000000..8642249 --- /dev/null +++ b/app/globals.css @@ -0,0 +1,1048 @@ +/* + * Doubt Docs. Colours and fonts are the same tokens as doubtbot.eu (doubt-site app/globals.css): + * dark plum by default, a light theme behind data-theme="light", violet to magenta accents. + */ + +:root, +:root[data-theme="dark"] { + color-scheme: dark; + --bg: #0f0a14; + --bg-deep: #150d1c; + --surface: #1a1022; + --surface-2: #241530; + --border: #2e1f3a; + --border-strong: #3a2749; + --text: #f3eefa; + --muted: #a995b8; + --violet: #8f16ab; + --magenta: #e5088f; + --tint-1: #b44fd0; + --tint-2: #d27cf0; + --tint-3: #ff5ec4; + --grad-text-from: #d27cf0; + --grad-text-to: #ff5ec4; + --glow: rgba(229, 8, 143, 0.28); + --halo: rgba(143, 22, 171, 0.35); + --link: #d27cf0; + --code-bg: #1e1428; + --success: #38d39f; + --warning: #ffb547; + --danger: #ff4d6d; + --header-bg: rgba(15, 10, 20, 0.82); +} + +:root[data-theme="light"] { + color-scheme: light; + --bg: #faf7fc; + --bg-deep: #f3ecf8; + --surface: #ffffff; + --surface-2: #f4edf9; + --border: #e7dcef; + --border-strong: #d8c8e4; + --text: #1c1225; + --muted: #6a5879; + --grad-text-from: #8f16ab; + --grad-text-to: #d1077f; + --glow: rgba(229, 8, 143, 0.18); + --halo: rgba(180, 79, 208, 0.22); + --link: #8f16ab; + --code-bg: #f4edf9; + --success: #0f8a5f; + --warning: #a35f00; + --danger: #c2183d; + --header-bg: rgba(250, 247, 252, 0.85); +} + +:root { + --font-display: var(--font-syne), ui-sans-serif, system-ui, sans-serif; + --font-sans: var(--font-manrope), ui-sans-serif, system-ui, sans-serif; + --font-mono: var(--font-jetbrains), ui-monospace, monospace; + --radius: 14px; + --radius-sm: 9px; + --header-h: 64px; + --sidebar-w: 260px; + --toc-w: 220px; +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html { + background: var(--bg); + scroll-behavior: smooth; + scroll-padding-top: calc(var(--header-h) + 16px); + -webkit-text-size-adjust: 100%; +} + +body { + margin: 0; + background: var(--bg); + color: var(--text); + font-family: var(--font-sans); + font-size: 16px; + line-height: 1.65; + -webkit-font-smoothing: antialiased; + overflow-x: hidden; +} + +a { + color: var(--link); + text-decoration: underline; + text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); + text-underline-offset: 3px; +} + +a:hover { + text-decoration-color: currentColor; +} + +:focus-visible { + outline: 2px solid var(--tint-2); + outline-offset: 2px; + border-radius: 4px; +} + +.grad-text { + background: linear-gradient(90deg, var(--grad-text-from), var(--grad-text-to)); + -webkit-background-clip: text; + background-clip: text; + color: transparent; +} + +.skip-link { + position: absolute; + left: 12px; + top: -48px; + z-index: 60; + padding: 8px 14px; + border-radius: var(--radius-sm); + background: var(--surface); + color: var(--text); +} + +.skip-link:focus { + top: 12px; +} + +/* ---------- Header ---------- */ + +.docs-header { + position: sticky; + top: 0; + z-index: 40; + height: var(--header-h); + border-bottom: 1px solid var(--border); +} + +/* The blur sits on a pseudo-element: backdrop-filter on the header itself would trap the + fixed mobile drawer inside the header's box. */ +.docs-header::before { + content: ""; + position: absolute; + inset: 0; + z-index: -1; + background: var(--header-bg); + backdrop-filter: blur(12px); +} + +.docs-header__inner { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + height: 100%; + max-width: 1440px; + margin: 0 auto; + padding: 0 16px; +} + +.docs-header__left, +.docs-header__right { + display: flex; + align-items: center; + gap: 10px; + min-width: 0; +} + +.docs-brand { + text-decoration: none; + color: inherit; + border-radius: var(--radius-sm); +} + +.brand-lockup { + display: inline-flex; + align-items: center; + gap: 10px; +} + +.brand-lockup__mark { + width: 32px; + height: 32px; +} + +.brand-lockup__text { + display: inline-flex; + align-items: baseline; + gap: 8px; + font-family: var(--font-display); + font-weight: 800; + font-size: 1.25rem; + letter-spacing: -0.01em; +} + +.brand-lockup__tag { + font-family: var(--font-sans); + font-size: 0.72rem; + font-weight: 700; + letter-spacing: 0.12em; + text-transform: uppercase; + color: var(--muted); +} + +.docs-header__link { + color: var(--muted); + font-weight: 600; + font-size: 0.92rem; + text-decoration: none; +} + +.docs-header__link:hover { + color: var(--text); +} + +.docs-header__cta { + display: inline-flex; + align-items: center; + height: 38px; + padding: 0 14px; + border-radius: 11px; + background: linear-gradient(90deg, var(--violet), var(--magenta)); + color: #fff; + font-weight: 700; + font-size: 0.9rem; + text-decoration: none; + white-space: nowrap; + box-shadow: 0 6px 24px -10px var(--glow); +} + +.icon-btn { + display: inline-flex; + align-items: center; + justify-content: center; + flex: none; + width: 38px; + height: 38px; + border: 1px solid var(--border); + border-radius: 11px; + background: var(--surface); + color: var(--muted); + cursor: pointer; +} + +.icon-btn:hover { + color: var(--text); + border-color: var(--tint-1); +} + +.icon-btn svg { + width: 18px; + height: 18px; +} + +.icon-moon { + display: none; +} + +[data-theme="light"] .icon-sun { + display: none; +} + +[data-theme="light"] .icon-moon { + display: block; +} + +.docs-menu-btn { + display: none; +} + +/* ---------- Search ---------- */ + +.search-trigger { + display: inline-flex; + align-items: center; + gap: 8px; + height: 38px; + min-width: 220px; + padding: 0 10px 0 12px; + border: 1px solid var(--border); + border-radius: 11px; + background: var(--surface); + color: var(--muted); + font: inherit; + font-size: 0.9rem; + cursor: pointer; +} + +.search-trigger:hover { + border-color: var(--tint-1); +} + +.search-trigger__label { + flex: 1; + text-align: left; +} + +kbd, +.search-trigger__kbd { + padding: 1px 6px; + border: 1px solid var(--border-strong); + border-radius: 6px; + font-family: var(--font-mono); + font-size: 0.72rem; + color: var(--muted); +} + +.search-dialog { + width: min(640px, calc(100vw - 32px)); + max-height: min(560px, calc(100dvh - 96px)); + margin: 72px auto auto; + padding: 0; + border: 1px solid var(--border-strong); + border-radius: var(--radius); + background: var(--surface); + color: var(--text); + box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); +} + +.search-dialog::backdrop { + background: rgba(10, 6, 14, 0.6); + backdrop-filter: blur(3px); +} + +.search-dialog__panel { + display: flex; + flex-direction: column; + max-height: inherit; +} + +.search-dialog__field { + display: flex; + align-items: center; + gap: 10px; + padding: 14px 16px; + border-bottom: 1px solid var(--border); + color: var(--muted); +} + +.search-dialog__field input { + flex: 1; + min-width: 0; + border: 0; + background: transparent; + color: var(--text); + font: inherit; + font-size: 1rem; + outline: none; +} + +.search-dialog__close { + padding: 2px 8px; + border: 1px solid var(--border-strong); + border-radius: 6px; + background: transparent; + color: var(--muted); + font-family: var(--font-mono); + font-size: 0.72rem; + cursor: pointer; +} + +.search-dialog__results { + overflow-y: auto; + padding: 8px; +} + +.search-dialog__empty { + margin: 0; + padding: 20px 12px; + color: var(--muted); +} + +.search-result { + display: flex; + flex-direction: column; + gap: 2px; + padding: 10px 12px; + border-radius: var(--radius-sm); + cursor: pointer; +} + +.search-result.is-active { + background: var(--surface-2); + box-shadow: inset 3px 0 0 var(--magenta); +} + +.search-result__group { + font-size: 0.72rem; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--muted); +} + +.search-result span:last-child:not(.search-result__group) { + font-size: 0.88rem; + color: var(--muted); +} + +/* ---------- Layout ---------- */ + +.docs-body { + display: grid; + grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); + gap: 40px; + max-width: 1440px; + margin: 0 auto; + padding: 0 16px; +} + +.docs-sidebar, +.docs-toc { + position: relative; +} + +.docs-sidebar__inner, +.docs-toc__inner { + position: sticky; + top: var(--header-h); + max-height: calc(100dvh - var(--header-h)); + overflow-y: auto; + padding: 28px 0 40px; +} + +.docs-main { + min-width: 0; + padding: 36px 0 72px; + outline: none; +} + +.docs-article { + max-width: 760px; +} + +/* ---------- Sidebar ---------- */ + +.docs-nav__group-title { + margin: 22px 0 6px; + padding: 0 10px; + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.14em; + text-transform: uppercase; + color: var(--muted); +} + +.docs-nav > div:first-child .docs-nav__group-title { + margin-top: 0; +} + +.docs-nav__list { + list-style: none; + margin: 0; + padding: 0; +} + +.docs-nav__link { + display: block; + padding: 6px 10px; + border-radius: var(--radius-sm); + color: var(--muted); + font-size: 0.93rem; + font-weight: 600; + text-decoration: none; +} + +.docs-nav__link:hover { + color: var(--text); + background: var(--surface); +} + +.docs-nav__link.is-active { + color: var(--text); + background: linear-gradient( + 90deg, + color-mix(in srgb, var(--violet) 28%, transparent), + transparent + ); + box-shadow: inset 2px 0 0 var(--magenta); +} + +/* ---------- Table of contents ---------- */ + +.toc__title { + margin: 0 0 8px; + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.14em; + text-transform: uppercase; + color: var(--muted); +} + +.toc ul { + list-style: none; + margin: 0; + padding: 0; + border-left: 1px solid var(--border); +} + +.toc li a { + display: block; + margin-left: -1px; + padding: 4px 0 4px 12px; + border-left: 2px solid transparent; + color: var(--muted); + font-size: 0.85rem; + text-decoration: none; +} + +.toc li.is-sub a { + padding-left: 24px; +} + +.toc li a:hover { + color: var(--text); +} + +.toc li a.is-active { + color: var(--text); + border-left-color: var(--magenta); +} + +/* ---------- Article ---------- */ + +.eyebrow { + margin: 0 0 6px; + font-size: 0.75rem; + font-weight: 800; + letter-spacing: 0.16em; + text-transform: uppercase; + color: var(--tint-3); +} + +.docs-article h1, +.docs-article h2, +.docs-article h3 { + font-family: var(--font-display); + line-height: 1.2; + letter-spacing: -0.015em; +} + +.docs-article h1 { + margin: 0 0 12px; + font-size: clamp(2rem, 4vw, 2.6rem); + font-weight: 800; +} + +.docs-article h1 + p { + font-size: 1.1rem; + color: var(--muted); +} + +.docs-article h2 { + margin: 48px 0 12px; + padding-top: 8px; + font-size: 1.55rem; + font-weight: 700; +} + +.docs-article h3 { + margin: 32px 0 8px; + font-size: 1.2rem; + font-weight: 700; +} + +.docs-article h2, +.docs-article h3 { + position: relative; +} + +.heading-anchor { + margin-left: 8px; + color: var(--muted); + text-decoration: none; + opacity: 0; + font-family: var(--font-sans); +} + +.docs-article h2:hover .heading-anchor, +.docs-article h3:hover .heading-anchor, +.heading-anchor:focus-visible { + opacity: 1; +} + +.docs-article p, +.docs-article ul, +.docs-article ol { + margin: 0 0 16px; +} + +.docs-article ul, +.docs-article ol { + padding-left: 1.4em; +} + +.docs-article li { + margin: 4px 0; +} + +.docs-article li::marker { + color: var(--tint-1); +} + +.docs-article strong { + font-weight: 700; +} + +.docs-article hr { + margin: 40px 0; + border: 0; + border-top: 1px solid var(--border); +} + +.docs-article code { + padding: 0.1em 0.4em; + border: 1px solid var(--border); + border-radius: 6px; + background: var(--code-bg); + font-family: var(--font-mono); + font-size: 0.86em; + overflow-wrap: anywhere; +} + +.docs-article pre { + margin: 0 0 20px; + padding: 14px 16px; + border: 1px solid var(--border); + border-radius: var(--radius-sm); + background: var(--code-bg); + overflow-x: auto; + font-size: 0.88rem; + line-height: 1.55; +} + +.docs-article pre code { + padding: 0; + border: 0; + background: none; + font-size: inherit; + overflow-wrap: normal; +} + +.docs-article blockquote { + margin: 0 0 16px; + padding: 4px 16px; + border-left: 3px solid var(--tint-1); + color: var(--muted); +} + +.table-wrap { + margin: 0 0 20px; + border: 1px solid var(--border); + border-radius: var(--radius-sm); + overflow-x: auto; +} + +.table-wrap table { + width: 100%; + border-collapse: collapse; + font-size: 0.92rem; +} + +.table-wrap th, +.table-wrap td { + padding: 10px 14px; + border-bottom: 1px solid var(--border); + text-align: left; + vertical-align: top; +} + +.table-wrap th { + background: var(--surface); + font-size: 0.78rem; + font-weight: 800; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--muted); + white-space: nowrap; +} + +.table-wrap tr:last-child td { + border-bottom: 0; +} + +/* ---------- Components ---------- */ + +.callout { + margin: 0 0 20px; + padding: 14px 16px; + border: 1px solid var(--border); + border-left: 3px solid var(--tint-1); + border-radius: var(--radius-sm); + background: var(--surface); +} + +.callout--tip { + border-left-color: var(--success); +} + +.callout--warning { + border-left-color: var(--warning); +} + +.callout--premium { + border-left-color: var(--magenta); + background: linear-gradient( + 120deg, + color-mix(in srgb, var(--violet) 14%, var(--surface)), + var(--surface) 60% + ); +} + +.docs-article .callout__title { + margin: 0 0 4px; + font-size: 0.8rem; + font-weight: 800; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--muted); +} + +.callout__body > :last-child { + margin-bottom: 0; +} + +.steps > ol { + list-style: none; + counter-reset: step; + padding-left: 0; +} + +.steps > ol > li { + position: relative; + counter-increment: step; + margin: 0; + padding: 0 0 20px 48px; + border-left: 1px solid var(--border); + margin-left: 15px; +} + +.steps > ol > li:last-child { + border-left-color: transparent; +} + +.steps > ol > li::before { + content: counter(step); + position: absolute; + left: -16px; + top: -2px; + display: grid; + place-items: center; + width: 32px; + height: 32px; + border-radius: 50%; + background: linear-gradient(135deg, var(--violet), var(--magenta)); + color: #fff; + font-weight: 800; + font-size: 0.9rem; +} + +.command-list { + display: grid; + gap: 12px; + margin: 0 0 24px; +} + +.command { + padding: 14px 16px; + border: 1px solid var(--border); + border-radius: var(--radius-sm); + background: var(--surface); +} + +.command__head { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; +} + +.docs-article .command__name { + padding: 0; + border: 0; + background: none; + font-size: 0.98rem; + font-weight: 600; + color: var(--text); + margin-right: auto; +} + +.pill { + display: inline-flex; + align-items: center; + padding: 1px 9px; + border: 1px solid var(--border-strong); + border-radius: 999px; + font-size: 0.75rem; + font-weight: 700; + color: var(--muted); + white-space: nowrap; +} + +.pill--open { + color: var(--success); + border-color: color-mix(in srgb, var(--success) 45%, transparent); +} + +.pill--premium { + color: var(--tint-3); + border-color: color-mix(in srgb, var(--magenta) 50%, transparent); +} + +.docs-article .command__desc { + margin: 6px 0 0; + color: var(--muted); + font-size: 0.93rem; +} + +.docs-article .command__options { + list-style: none; + margin: 10px 0 0; + padding: 10px 0 0; + border-top: 1px dashed var(--border); + font-size: 0.88rem; +} + +.command__options li { + display: flex; + flex-wrap: wrap; + gap: 4px 8px; + align-items: baseline; +} + +.command__options li span:last-child { + color: var(--muted); +} + +.command__req { + font-size: 0.7rem; + font-weight: 800; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--warning); +} + +.card-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + gap: 12px; + margin: 0 0 24px; +} + +.card-grid a { + display: block; + padding: 16px; + border: 1px solid var(--border); + border-radius: var(--radius-sm); + background: var(--surface); + color: var(--text); + text-decoration: none; +} + +.card-grid a:hover { + border-color: var(--tint-1); + box-shadow: 0 10px 30px -18px var(--glow); +} + +.card-grid strong { + display: block; + margin-bottom: 4px; + font-family: var(--font-display); + font-size: 1.05rem; +} + +.card-grid span { + color: var(--muted); + font-size: 0.9rem; + line-height: 1.5; +} + +/* ---------- Footer ---------- */ + +.docs-footer { + border-top: 1px solid var(--border); + background: var(--bg-deep); +} + +.docs-footer__inner { + display: grid; + grid-template-columns: 1.4fr repeat(4, 1fr); + gap: 32px; + max-width: 1440px; + margin: 0 auto; + padding: 44px 16px 24px; +} + +.docs-footer__brand p { + margin: 10px 0 0; + color: var(--muted); + font-size: 0.9rem; +} + +.docs-footer__title { + margin: 0 0 10px; + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.14em; + text-transform: uppercase; + color: var(--muted); +} + +.docs-footer__col ul { + list-style: none; + margin: 0; + padding: 0; +} + +.docs-footer__col li { + margin: 0 0 6px; +} + +.docs-footer__col a { + color: var(--text); + font-size: 0.9rem; + font-weight: 600; + text-decoration: none; +} + +.docs-footer__col a:hover { + color: var(--tint-2); +} + +.docs-footer__legal { + max-width: 1440px; + margin: 0 auto; + padding: 0 16px 28px; + color: var(--muted); + font-size: 0.82rem; +} + +/* ---------- Mobile drawer ---------- */ + +.drawer-backdrop { + position: fixed; + inset: 0; + z-index: 50; + background: rgba(10, 6, 14, 0.6); + opacity: 0; + pointer-events: none; + transition: opacity 0.2s; +} + +.drawer-backdrop.is-open { + opacity: 1; + pointer-events: auto; +} + +.drawer { + position: fixed; + inset: 0 auto 0 0; + z-index: 51; + width: min(320px, 86vw); + padding: 14px 14px 32px; + overflow-y: auto; + border-right: 1px solid var(--border); + background: var(--bg); + transform: translateX(-100%); + transition: transform 0.22s ease; +} + +.drawer.is-open { + transform: none; +} + +.drawer__head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 18px; +} + +@media (prefers-reduced-motion: reduce) { + html { + scroll-behavior: auto; + } + .drawer, + .drawer-backdrop { + transition: none; + } +} + +/* ---------- Responsive ---------- */ + +@media (max-width: 1180px) { + .docs-body { + grid-template-columns: var(--sidebar-w) minmax(0, 1fr); + } + .docs-toc { + display: none; + } + .docs-footer__inner { + grid-template-columns: repeat(3, 1fr); + } + .docs-footer__brand { + grid-column: 1 / -1; + } +} + +@media (max-width: 860px) { + .docs-body { + grid-template-columns: minmax(0, 1fr); + } + .docs-sidebar { + display: none; + } + .docs-menu-btn { + display: inline-flex; + } + .docs-header__link { + display: none; + } + .search-trigger { + min-width: 0; + } + .docs-main { + padding-top: 24px; + } +} + +@media (max-width: 600px) { + .search-trigger__label, + .search-trigger__kbd, + .docs-header__cta { + display: none; + } + .search-trigger { + width: 38px; + justify-content: center; + padding: 0; + } + .brand-lockup__tag { + display: none; + } + .docs-footer__inner { + grid-template-columns: repeat(2, 1fr); + } +} diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..b93d734 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,64 @@ +import type { Metadata, Viewport } from 'next'; +import { JetBrains_Mono, Manrope, Syne } from 'next/font/google'; +import { SITE_URL } from '@/lib/links'; +import { siteName } from '@/lib/nav'; +import './globals.css'; + +// Same fonts as doubtbot.eu. +const syne = Syne({ subsets: ['latin'], weight: ['700', '800'], variable: '--font-syne' }); +const manrope = Manrope({ subsets: ['latin'], variable: '--font-manrope' }); +const jetbrains = JetBrains_Mono({ subsets: ['latin'], variable: '--font-jetbrains' }); + +const description = + 'How to set up and use Doubt, the Discord bot for moderation, AutoMod, tickets, welcome messages, levelling and an economy.'; + +export const metadata: Metadata = { + metadataBase: new URL(SITE_URL), + title: { default: siteName, template: `%s · ${siteName}` }, + description, + applicationName: siteName, + authors: [{ name: 'Doubt Productions' }], + icons: { + icon: [ + { url: '/brand/doubt-app-icon.svg', type: 'image/svg+xml' }, + { url: '/brand/doubt-app-icon.png', type: 'image/png', sizes: '1024x1024' }, + ], + apple: [{ url: '/brand/doubt-app-icon.png', sizes: '1024x1024' }], + }, + openGraph: { + type: 'website', + url: SITE_URL, + siteName, + title: siteName, + description, + locale: 'en_GB', + images: [{ url: '/brand/doubt-banner.png', width: 2400, height: 848, alt: 'Doubt' }], + }, +}; + +export const viewport: Viewport = { + themeColor: [ + { media: '(prefers-color-scheme: dark)', color: '#0f0a14' }, + { media: '(prefers-color-scheme: light)', color: '#faf7fc' }, + ], +}; + +// Runs before first paint: a saved choice wins, then the system preference, then dark. +const themeScript = `(function(){try{var t=localStorage.getItem('theme');if(t!=='light'&&t!=='dark'){t=window.matchMedia('(prefers-color-scheme: light)').matches?'light':'dark'}document.documentElement.dataset.theme=t}catch(e){document.documentElement.dataset.theme='dark'}})();`; + +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + + + {/* biome-ignore lint/security/noDangerouslySetInnerHtml: static theme script, no user input */} +