From b7da03f701bd3fdfcab1ec094142b150885c6e0f Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 4 Jan 2024 21:57:54 -0500 Subject: [PATCH] feat(docs): bunch of updates and changes and crap --- .docs/.markdownlint.json | 4 + .docs/aurora.md | 95 ------------- .docs/aurora/case-commands.md | 52 +++++++ .docs/aurora/configuration.md | 204 ++++++++++++++++++++++++++++ .docs/aurora/index.md | 11 ++ .docs/aurora/moderation-commands.md | 82 +++++++++++ .docs/nerdify.md | 12 +- mkdocs.yml | 12 +- nerdify/nerdify.py | 10 +- 9 files changed, 369 insertions(+), 113 deletions(-) create mode 100644 .docs/.markdownlint.json delete mode 100644 .docs/aurora.md create mode 100644 .docs/aurora/case-commands.md create mode 100644 .docs/aurora/configuration.md create mode 100644 .docs/aurora/index.md create mode 100644 .docs/aurora/moderation-commands.md diff --git a/.docs/.markdownlint.json b/.docs/.markdownlint.json new file mode 100644 index 0000000..7d468df --- /dev/null +++ b/.docs/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD007": { "indent": 4 } +} diff --git a/.docs/aurora.md b/.docs/aurora.md deleted file mode 100644 index 87e786b..0000000 --- a/.docs/aurora.md +++ /dev/null @@ -1,95 +0,0 @@ -# Aurora - -Aurora is a fully-featured moderation system. It is heavily inspired by GalacticBot, and is designed to be a more user-friendly alternative to Red's core Mod cogs. - -## Installation - -```bash -[p]repo add seacogs https://coastalcommits.com/SeaswimmerTheFsh/SeaCogs -[p]cog install seacogs aurora -[p]cog load aurora -``` - -## Commands List - -### Slash Commands - -#### Moderation Commands - -- `/note` - Add a note to a user - - Arguments: - - `target` - Accepts User IDs and mentions - This is who you're adding a note to - - `reason` - Reason for adding a note to the user - - `silent` - ***Optional*** - Toggles if the bot will try to send a direct message to the targeted user - Set to the value set by the `[p]moderationset dm` command by default -- `/warn` - Warn a user - - Arguments: - - `target` - Accepts User IDs and mentions - This is who you're warning - - `reason` - Reason for warning the user - - `silent` - ***Optional*** - Toggles if the bot will try to send a direct message to the targeted user - Set to the value set by the `[p]moderationset dm` command by default -- `/mute` - Mute a member - Doesn't work if the member is already muted! - - Arguments: - - `target` - Accepts User IDs and mentions - Must be in the discord server - This is who you're muting - - `duration` - Accepts any combination of duration units, as shown below - Maximum duration of [28 days](https://discord.com/developers/docs/resources/guild#modify-guild-member-json-params) - - ``2 d`` - - ``2 days`` - - ``1w`` - - ``1 week`` - - ``1w 4 days 3h 67minutes`` - - ``2w5d7h24m`` - - `reason` - Reason for muting the member - - `silent` - ***Optional*** - Toggles if the bot will try to send a direct message to the targeted member - Set to the value set by the `[p]moderationset dm` command by default -- `/unmute` - Unmute a member - Only works if the member is muted! - - Arguments: - - `target` - Accepts User IDs and mentions - Must be in the discord server - This is who you're unmuting - - `reason` - ***Optional*** - Reason for unmuting the member - - `silent` - ***Optional*** - Toggles if the bot will try to send a direct message to the targeted member - Set to the value set by the `[p]moderationset dm` command by default -- `/ban` - Ban a user - Doesn't work if the user is already banned - - Arguments: - - `target` - Accepts User IDs and mentions - This is who you're banning - - `reason` - Reason for banning the user - - `duration` - ***Optional*** - Accepts any combination of duration units, as shown in the mute command - - `silent` - ***Optional*** - Toggles if the bot will try to send a direct message to the targeted user - Set to the value set by the `[p]moderationset dm` command by default -- `/unban` - Unban a user - Only works if the user is banned! - - Arguments: - - `target` - Accepts User IDs and mentions - This is who you're unbanning - - `reason` - ***Optional*** - Reason for unbanning the user - - `silent` - ***Optional*** - Toggles if the bot will try to send a direct message to the targeted user - Set to the value set by the `[p]moderationset dm` command by default - -#### Case Commands - -- `/case` - Check the details of a specific case, by case number - - Arguments: - - `case_number` - Accepts case numbers - See `/history` to get a list of these - - `ephemeral` - ***Optional*** - Toggles if the response message will be hidden or not - Defaults to `false` -- `/history` - Checks the list of cases for a target, a moderator, or for the server - - Arguments - *All arguments of this command are optional*: - - `target` - Accepts User IDs and mentions - This is whose moderations you're querying - overrides `moderator` if both are given - - `moderator` - Accepts User IDs and mentions - This is the moderator whose moderations you're querying - - `pagesize` - Determines how many cases to list per `page` - Defaults to `5` - Maximum of `25` - - `page` - Determines which page to check - - `ephemeral` - Toggles if the response message will be hidden or not - Defaults to `false` - - `export` - Exports the moderation history of the entire server in a `.json` file - Defaults to `false` - - Notes: - - If `target` and `moderator` are not used, this command will query by all moderations in the server. -- `/resolve` - Resolves a case/moderation - - Arguments: - - `case_number` - Accepts case numbers - See `/history` to get a list of these - - `reason` - ***Optional*** - Reason for resolving the case - - Notes: - - If a `TEMPBAN` or `MUTE` is resolved before it expires, or a `BAN` is resolved, the targeted user will be unbanned/unmuted. - - Please resolve cases instead of unmuting/unbanning! - -### Text Commands - -- `[p]moderationset` - - This command handles the configuration for the Moderation cog - - Sub-commands: - - `[p]moderationset dm` - Server Administrator only - Per Guild - - This command toggles if the `silent` argument in Moderation slash commands will default to `true` or `false`. Defaults to `false`. - - `[p]moderationset ignorebots` - Server Administrator only - Per Guild - - This command toggles if the Moderation cog will automatically log moderations from other bots. Defaults to `false`. - - `[p]moderationset mysql` - Bot Owner only - Per Bot - - This command sends a direct message to the user with a modal to configure the MySQL settings. - - **This cog REQUIRES a configured MySQL database to function.** -- `[p]timedeltaconvert` - - Uses the same logic as `/mute` and `/unban` to generate timedeltas from human-readable input. diff --git a/.docs/aurora/case-commands.md b/.docs/aurora/case-commands.md new file mode 100644 index 0000000..48ecc16 --- /dev/null +++ b/.docs/aurora/case-commands.md @@ -0,0 +1,52 @@ +# Case Commands + +/// admonition | These commands are slash commands. + type: warning +Please make sure to enable them with [`[p]slash enable `](https://docs.discord.red/en/stable/cog_guides/core.html#slash-enable), then sync them with [`[p]slash sync`](https://docs.discord.red/en/stable/cog_guides/core.html#slash-sync). +/// + +## history + +/// admonition | All of the arguments for this command are optional. + type: info +/// + +- Usage: `/history [target] [moderator] [pagesize] [page] [ephemeral] [inline] [export]` + - If both `target` and `moderator` are not present, all moderations for the server will be queried. +- `target:` User whose infractions to query, overrides moderator if both are given +- `moderator:` Moderator whose infractions to query +- `pagesize:` Amount of infractions to list per page +- `page:` Page to select +- `ephemeral:` Hide the command response +- `inline:` Display infractions in a grid arrangement +- `export:` Exports the server's entire moderation history to a JSON file + +List previous infractions. + +## resolve + +- Usage: `/resolve [reason]` +- `case:` (Required) Case number of the case you're trying to resolve +- `reason:` (Optional) Reason for resolving case + +Resolve a specific case. + +## case + +- Usage: `/case [ephemeral] [evidenceformat] [changes] [export]` +- `case:` (Required) What case are you looking up? +- `ephemeral:` (Optional) Hide the command response +- `evidenceformat:` (Optional) … +- `changes:` (Optional) List the changes made to the case +- `export:` (Optional) Export the case to a JSON file or codeblock + +Check the details of a specific case. + +## edit + +- Usage: `/edit [duration]` +- `case:` (Required) What case are you editing? +- `reason:` (Required) What is the new reason? +- `duration:` (Optional) What is the new duration? Does not reapply the moderation if it has already expired. + +Edit the reason of a specific case. diff --git a/.docs/aurora/configuration.md b/.docs/aurora/configuration.md new file mode 100644 index 0000000..0c73acf --- /dev/null +++ b/.docs/aurora/configuration.md @@ -0,0 +1,204 @@ +# Configuration + +## auroraset + - Usage: `[p]auroraset` + - Aliases: `moderationset, modset, moderationsettings, aurorasettings, and auroraconfig` + +Manage moderation commands. + +### auroraset ignorebots + - Usage: `[p]auroraset ignorebots` + - Restricted to: `ADMIN` + +Toggle if the cog should ignore other bots' moderations. + +### auroraset user + - Usage: `[p]auroraset user` + +Manage configurations for user configuration options. + +#### auroraset user history + - Usage: `[p]auroraset user history` + +Manage configuration for the /history command. + +##### auroraset user history inline + - Usage: `[p]auroraset user history inline` + +Manage configuration for the /history command's inline argument. + +###### auroraset user history inline toggle + - Usage: `[p]auroraset user history inline toggle ` + +Enable the /history command's inline argument by default. + +##### auroraset user history inline pagesize + - Usage: `[p]auroraset user history inline pagesize ` + +Set the amount of cases to display per page. + +#### auroraset user history pagesize + - Usage: `[p]auroraset user history pagesize ` + +Set the amount of cases to display per page. + +#### auroraset user history ephemeral + - Usage: `[p]auroraset user history ephemeral ` + - Aliases: `hidden and hide` + +Toggle if the /history command should be ephemeral. + +### auroraset user autoevidence + - Usage: `[p]auroraset user autoevidence ` + +Toggle if the evidenceformat codeblock should be sent automatically. + +## auroraset server + - Usage: `[p]auroraset server` + - Restricted to: `ADMIN` + +Manage default configurations for user configuration options, per server. + +### auroraset server history + - Usage: `[p]auroraset server history` + - Restricted to: `ADMIN` + +Manage configuration for the /history command. + +#### auroraset server history inline + - Usage: `[p]auroraset server history inline` + - Restricted to: `ADMIN` + +Manage configuration for the /history command's inline argument. + +##### auroraset server history inline pagesize + - Usage: `[p]auroraset server history inline pagesize ` + - Restricted to: `ADMIN` + +Set the amount of cases to display per page. + +##### auroraset server history inline toggle + - Usage: `[p]auroraset server history inline toggle ` + - Restricted to: `ADMIN` + +Enable the /history command's inline argument by default. + +#### auroraset server history ephemeral + - Usage: `[p]auroraset server history ephemeral ` + - Restricted to: `ADMIN` + - Aliases: `hidden and hide` + +Toggle if the /history command should be ephemeral. + +#### auroraset server history pagesize + - Usage: `[p]auroraset server history pagesize ` + - Restricted to: `ADMIN` + +Set the amount of cases to display per page. + +### auroraset server autoevidence + - Usage: `[p]auroraset server autoevidence ` + +Toggle if the evidenceformat codeblock should be sent automatically. + +## auroraset showmoderator + - Usage: `[p]auroraset showmoderator` + - Restricted to: `ADMIN` + +Toggle if the cog should show the moderator in the case embed when dming a user. + +## auroraset immunity + - Usage: `[p]auroraset immunity` + - Restricted to: `ADMIN` + +Manage configuration for immune roles. + +### auroraset immunity add + - Usage: `[p]auroraset immunity add ` + - Restricted to: `ADMIN` + +Add a role to the immune roles list. + +### auroraset immunity remove + - Usage: `[p]auroraset immunity remove ` + - Restricted to: `ADMIN` + +Remove a role from the immune roles list. + +### auroraset immunity list + - Usage: `[p]auroraset immunity list` + - Restricted to: `ADMIN` + +List all immune roles. + +## auroraset permissions + - Usage: `[p]auroraset permissions` + - Restricted to: `ADMIN` + +Toggle whether the bot will check for discord permissions. + +## auroraset logchannel + - Usage: `[p]auroraset logchannel [channel=None]` + - Restricted to: `ADMIN` + +Set a channel to log infractions to. + +## auroraset import + - Usage: `[p]auroraset import` + - Restricted to: `ADMIN` + +Import moderations from other bots. + +### auroraset import galacticbot + - Usage: `[p]auroraset import galacticbot` + - Restricted to: `ADMIN` + +Import moderations from GalacticBot. + +### auroraset import aurora + - Usage: `[p]auroraset import aurora` + - Restricted to: `ADMIN` + +Import moderations from another bot using Aurora. + +## auroraset dm + - Usage: `[p]auroraset dm` + - Restricted to: `ADMIN` + +Toggle automatically messaging moderated users.

This option can be overridden by specifying the `silent` argument in any moderation command. + +## auroraset list + - Usage: `[p]auroraset list` + - Aliases: `view and show` + +List all moderation settings. + +## auroraset blacklist + - Usage: `[p]auroraset blacklist` + - Restricted to: `ADMIN` + +Manage configuration for the /blacklist command. + +### auroraset blacklist list + - Usage: `[p]auroraset blacklist list` + - Restricted to: `ADMIN` + +List all blacklist types. + +### auroraset blacklist remove + - Usage: `[p]auroraset blacklist remove ` + - Restricted to: `ADMIN` + +Remove a role's blacklist type. + +### auroraset blacklist add + - Usage: `[p]auroraset blacklist add ` + - Restricted to: `ADMIN` + +Add a role to the blacklist. + +# timedeltaconvert + - Usage: `[p]timedeltaconvert ` + - Aliases: `tdc` + +This command converts a duration to a [`timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta) Python object.

**Example usage**
`[p]timedeltaconvert 1 day 15hr 82 minutes 52s`
**Output**
`1 day, 16:22:52` diff --git a/.docs/aurora/index.md b/.docs/aurora/index.md new file mode 100644 index 0000000..0c59c59 --- /dev/null +++ b/.docs/aurora/index.md @@ -0,0 +1,11 @@ +# Aurora + +Aurora is a fully-featured moderation system. It is heavily inspired by GalacticBot, and is designed to be a more user-friendly alternative to Red's core Mod cogs. + +## Installation + +```bash +[p]repo add seacogs https://coastalcommits.com/SeaswimmerTheFsh/SeaCogs +[p]cog install seacogs aurora +[p]cog load aurora +``` diff --git a/.docs/aurora/moderation-commands.md b/.docs/aurora/moderation-commands.md new file mode 100644 index 0000000..058afab --- /dev/null +++ b/.docs/aurora/moderation-commands.md @@ -0,0 +1,82 @@ +# Moderation Commands + +/// admonition | These commands are slash commands. + type: warning +Please make sure to enable them with [`[p]slash enable `](https://docs.discord.red/en/stable/cog_guides/core.html#slash-enable), then sync them with [`[p]slash sync`](https://docs.discord.red/en/stable/cog_guides/core.html#slash-sync). +/// + +## note + +- Usage: `/note [silent]` +- `target:` (Required) Who are you noting? +- `reason:` (Required) Why are you noting this user? +- `silent:` (Optional) Should the user be messaged? + +Add a note to a user. + +## warn + +- Usage: `/warn [silent]` +- `target:` (Required) Who are you warning? +- `reason:` (Required) Why are you warning this user? +- `silent:` (Optional) Should the user be messaged? + +Warn a user. + +## blacklist + +- Usage: `/blacklist [silent]` +- `target:` (Required) Who are you blacklisting? +- `role:` (Required) What blacklist type are you applying to the target? +- `reason:` (Required) Why are you blacklisting this user? +- `silent:` (Optional) Should the user be messaged? + +Add a blacklist role to a user. + +## mute + +- Usage: `/mute [silent]` +- `target:` (Required) Who are you unbanning? +- `duration:` (Required) How long are you muting this user for? +- `reason:` (Required) Why are you unbanning this user? +- `silent:` (Optional) Should the user be messaged? + +Mute a user. + +## unmute + +- Usage: `/unmute [reason] [silent]` +- `target:` (Required) Who are you unmuting? +- `reason:` (Optional) Why are you unmuting this user? +- `silent:` (Optional) Should the user be messaged? + +Unmute a user. + +## kick + +- Usage: `/kick [silent]` +- `target:` (Required) Who are you kicking? +- `reason:` (Required) Why are you kicking this user? +- `silent:` (Optional) Should the user be messaged? + +Kick a user. + +## ban + +- Usage: `/ban [duration] [delete_messages] [silent]` +- `target:` (Required) Who are you banning? +- `reason:` (Required) Why are you banning this user? +- `duration:` (Optional) How long are you banning this user for? +- `delete_messages:` (Optional) How many days of messages to delete? +- `silent:` (Optional) Should the user be messaged? + +Ban a user. + +## unban + +- Usage: `/unban [reason] [silent]` +- `target:` (Required) Who are you unbanning? +- `reason:` (Optional) Why are you unbanning this user? +- `silent:` (Optional) Should the user be messaged? + +Unban a user. diff --git a/.docs/nerdify.md b/.docs/nerdify.md index 2099f3d..f801d29 100644 --- a/.docs/nerdify.md +++ b/.docs/nerdify.md @@ -12,16 +12,16 @@ Nerdify allows you to nerdify other people's text. ## Commands -### `[p]nerdify` +### nerdify -::: nerdify.nerdify.Nerdify.nerdify +- Usage: `[p]nerdify [text]` +- Aliases: `nerd` + +Nerdify the replied to message, previous message, or your own text. +If `[text]` is not provided, the bot will try to nerdify either the previous message or the replied to message, if the invocation message is a reply. ## Method Reference -### `nerdify_text` - ::: nerdify.nerdify.Nerdify.nerdify_text -### `type_message` - ::: nerdify.nerdify.Nerdify.type_message diff --git a/mkdocs.yml b/mkdocs.yml index 507cb2d..470aa1b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,13 +11,17 @@ site_description: Documentation for my Red-DiscordBot Cogs. nav: - Home: index.md - - Aurora: aurora.md + - Aurora: + - Home: aurora/index.md + - Moderation Commands: aurora/moderation-commands.md + - Case Commands: aurora/case-commands.md + - Configuration: aurora/configuration.md - Nerdify: nerdify.md plugins: - git-authors - search -# - social + - social - git-revision-date-localized: enable_creation_date: true type: timeago @@ -30,7 +34,8 @@ plugins: docstring_options: ignore_imit_summary: true summary: true - show_root_toc_entry: false + show_root_toc_entry: true + show_root_heading: true filters: - "!^___" @@ -63,6 +68,7 @@ theme: - content.code.annotate - content.code.copy - navigation.instant + - navigation.tabs - search.suggest - search.highlight - search.share diff --git a/nerdify/nerdify.py b/nerdify/nerdify.py index cac0e7f..588d210 100644 --- a/nerdify/nerdify.py +++ b/nerdify/nerdify.py @@ -21,15 +21,7 @@ class Nerdify(commands.Cog): @commands.command(aliases=["nerd"]) async def nerdify(self, ctx: commands.Context, *, text: Optional[str] = None) -> None: - """Nerdify the replied to message, previous message, or your own text. - - Example: - ``[p]nerdify hello world!`` - > "hello world!" :nerd: - - Args: - text: The text to nerdify. If not provided, the bot will try to nerdify either the previous message or the replied to message, if the invocation message is a reply. - """ + """Nerdify the replied to message, previous message, or your own text.""" if not text: if hasattr(ctx.message, "reference") and ctx.message.reference: with suppress(