Document self hosting and add command handling#119
Document self hosting and add command handling#119tomgelu wants to merge 4 commits intoDigitalPulseSoftware:masterfrom
Conversation
Document all modules, commands, configuration options and bot behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Equinox4
left a comment
There was a problem hiding this comment.
premier jet, d'autres passages seront nécessaires
| - `help` — lists all commands you have access to. Use `help <command>` for details on a specific command. Results are paginated with Previous/Next buttons. | ||
|
|
||
| **Argument syntax:** | ||
| - Required arguments: `arg` |
There was a problem hiding this comment.
| - Required arguments: `arg` | |
| - Required arguments: `<arg>` |
|
|
||
| Most moderation commands are **silent** — they delete your invoking message after running. | ||
|
|
||
| **Permission checks** are per-command. Users without the required role or Discord permission are silently ignored. |
There was a problem hiding this comment.
are silently ignored
not always true
|
|
||
| **Notes:** | ||
| - Bans are tracked with expiration times. The bot automatically unbans when the duration expires. | ||
| - You cannot ban someone with a higher or equal role than yours. |
|
|
||
| **Notes:** | ||
| - The bot automatically sets the mute role permissions on all text and voice channels (denies send messages, add reactions, speak). | ||
| - If a muted user leaves and rejoins, the mute role is reapplied. |
There was a problem hiding this comment.
| - If a muted user leaves and rejoins, the mute role is reapplied. | |
| - If a muted user leaves and rejoins the guild, the mute role is reapplied. |
| - Default: 10 joins in 5 seconds triggers a 10-minute lock. | ||
|
|
||
| **Spam score detection:** | ||
| - Each message receives a score based on content: | ||
| - Base: **+1** per message | ||
| - **+1** per spam keyword (`nitro`, `free`, `crypto`, `steam`, `discord`, etc.) | ||
| - **+1** if a spam hint is present (`gift`, `bitcoin`, `airdrop`, etc.) | ||
| - **+1** per unique user ping | ||
| - **×2** for `@everyone`, `@here`, or role pings | ||
| - **×2** for non-Discord external links | ||
| - **+1** for each channel switch | ||
| - Score compounds for repeated content |
There was a problem hiding this comment.
no really needs for describing the algo and keywords in the readme, it is subject to change
| - Default: 10 joins in 5 seconds triggers a 10-minute lock. | |
| **Spam score detection:** | |
| - Each message receives a score based on content: | |
| - Base: **+1** per message | |
| - **+1** per spam keyword (`nitro`, `free`, `crypto`, `steam`, `discord`, etc.) | |
| - **+1** if a spam hint is present (`gift`, `bitcoin`, `airdrop`, etc.) | |
| - **+1** per unique user ping | |
| - **×2** for `@everyone`, `@here`, or role pings | |
| - **×2** for non-Discord external links | |
| - **+1** for each channel switch | |
| - Score compounds for repeated content |
|
|
||
| | Command | Usage | Description | | ||
| |---|---|---| | ||
| | `newticket` | `newticket [member] [message]` | Opens a modmail ticket (optionally on behalf of a member). | |
There was a problem hiding this comment.
(optionally on behalf of a member)
?
no
| | Command | Usage | Description | | ||
| |---|---|---| | ||
| | `newticket` | `newticket [member] [message]` | Opens a modmail ticket (optionally on behalf of a member). | | ||
| | `modticket` | `modticket <member> [message]` | Opens a ticket for a member (staff only). | |
|
|
||
| | Command | Usage | Description | | ||
| |---|---|---| | ||
| | `prune` | `prune <count>` | Deletes the last N messages (max 100, no older than 14 days). | |
There was a problem hiding this comment.
| | `prune` | `prune <count>` | Deletes the last N messages (max 100, no older than 14 days). | | |
| | `prune` | `prune <count>` | Deletes the last N messages (no older than 14 days). | |
| | Command | Usage | Description | | ||
| |---|---|---| | ||
| | `pin` | `pin <messageId>` | Pins a message. Requires Manage Messages or channel ownership. | | ||
| | `unpin` | `unpin <messageId>` | Unpins a message. | |
There was a problem hiding this comment.
requires same permission as pin
|
|
||
| | Command | Usage | Description | | ||
| |---|---|---| | ||
| | `sendmessage` | `sendmessage [channel] [content]` | Sends a message (or opens an interactive editor) as the bot. | |
There was a problem hiding this comment.
| | `sendmessage` | `sendmessage [channel] [content]` | Sends a message (or opens an interactive editor) as the bot. | | |
| | `sendmessage` | `sendmessage [channel] [content]` | Sends a message as the bot. | |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
||
| Commands are triggered by: | ||
| - A prefix (configurable per server, default `!`), e.g. `!ban @user` | ||
| - Or a direct mention of the bot, e.g. `@NotaBot ban @user` |
There was a problem hiding this comment.
du coup on peut remettre ceci, my bad
- bot.lua: add messageContent privileged gateway intent so the bot can read message content (required since Discord API v10) - test_bot.lua: Lua test bot using Discordia to validate documented commands - test_bot.py: Python test bot (discord.py) used to run the command suite (requires TEST_BOT_TOKEN, TARGET_BOT_ID, TEST_GUILD_ID, TEST_CHANNEL_ID, TEST_USER_ID env vars or fill in the CONFIG section) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
why have you created a python file? |
|
|
||
| -- ── Configuration ──────────────────────────────────────────────────────────── | ||
|
|
||
| local TOKEN = os.getenv("TEST_BOT_TOKEN") or "" -- token of your test bot app |
There was a problem hiding this comment.
| local TOKEN = os.getenv("TEST_BOT_TOKEN") or "" -- token of your test bot app | |
| local TOKEN = os.getenv("TEST_BOT_TOKEN") -- token of your test bot app |
| local TARGET_USER = os.getenv("TEST_USER_ID") or "" -- a member ID to use as moderation target | ||
| local PREFIX = os.getenv("BOT_PREFIX") or "!" | ||
|
|
||
| assert(TOKEN ~= "", "TEST_BOT_TOKEN is required — set the env var or paste it above") |
There was a problem hiding this comment.
| assert(TOKEN ~= "", "TEST_BOT_TOKEN is required — set the env var or paste it above") | |
| assert(TOKEN ~= nil, "TEST_BOT_TOKEN is required — set the env var") |
|
|
||
| local TOKEN = os.getenv("TEST_BOT_TOKEN") or "" -- token of your test bot app | ||
| local TARGET_BOT = os.getenv("TARGET_BOT_ID") or "" -- user ID of the NotaBot instance | ||
| local GUILD_ID = os.getenv("TEST_GUILD_ID") or "" -- your server ID |
There was a problem hiding this comment.
make these variables required as well
|
|
||
| -- Print summary | ||
| print("\n" .. string.rep("─", 60)) | ||
| print(string.format("%-40s %-8s %s", "COMMAND", "RESULT", "RESPONSE")) |
There was a problem hiding this comment.
can't we use "p()" func here?
| if r.passed then passed = passed + 1 else failed = failed + 1 end | ||
| end | ||
| print(string.rep("─", 60)) | ||
| print(string.format("Total: %d passed, %d failed / %d", passed, failed, passed + failed)) |
Document all modules, commands, configuration options and bot behavior.