Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added information about warnings. #3

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Writerside/dhub.tree
Original file line number Diff line number Diff line change
@@ -11,10 +11,12 @@
<toc-element topic="Features.md">
<toc-element topic="Embed-Management.md"/>
<toc-element topic="Role-Management.md"/>
<toc-element topic="Server-Property.md"/>
<toc-element topic="Warnings.md"/>
</toc-element>
<toc-element topic="Commands.md">
<toc-element topic="calc-price.topic"/>
<toc-element topic="config.topic"/>
<toc-element topic="leaderboard.topic"/>
<toc-element topic="manage-score.topic">
<toc-element topic="manage-score-add.topic"/>
Binary file added Writerside/images/warn-deactivate-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/warn-deactivate-not-found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion Writerside/topics/Dungeon-Hub-API.topic
Original file line number Diff line number Diff line change
@@ -2,13 +2,14 @@
<!DOCTYPE topic SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
id="Dungeon-Hub-API" title="Dungeon Hub API">
id="Dungeon-Hub-API" title="Dungeon Hub API ✏️">
<chapter title="What is the Dungeon Hub API" id="what-is-the-dungeon-hub-api">
<p>The Dungeon Hub API hosts all data that is used in the <a href="Dungeon-Hub-Bot.md"/>. <br/>The <a
href="Dungeon-Hub-Bot.md"/> itself only serves as a client to interact with the API - it does not have
any database access and only persists data through the API. A documentation with all endpoints and their
usage can be found at <a href="https://api.dungeon-hub.net/"/>.</p>
</chapter>

<chapter title="Authentication" id="authentication">
<p>Most endpoints of the Dungeon Hub API require authentication. <br/>The API uses bearer tokens for
authentication, meaning an Authorization header containing the JWT token must be attached
@@ -36,6 +37,7 @@
client secret as password).</p>
</chapter>
</chapter>

<chapter title="Connecting to the API" id="connecting-to-the-api">
<p>All API endpoints are reachable under <a href="https://api.dungeon-hub.net/"/>. A simple documentation of
all endpoints is available there. <br/>To ease the connection to the API, a Kotlin/JVM library containing
56 changes: 56 additions & 0 deletions Writerside/topics/Server-Property.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Server Property ✏️

The server property is a way to store and manage server-specific settings that are used across multiple commands.
This includes settings like the moderation log channel, the strike log channel, the score management role, and more.

The settings can be changes using the sub-commands of [](config.topic). \
A list of all available server properties can be found below.

## String / Text

- `BAN_MESSAGE`: The message that is sent to a user when they are banned from the server. It can contain some
placeholders:
- `%\server%`: The name of the server
- `%\form%`: The unban form, if present
- `UNBAN_FORM`: The link to the unban form that is sent to a user when they are banned from the server. If it is
present, it will be attached to the message as a link button, so please make sure that it is in a proper link format.

## Number

`currently none`

## Boolean (true/false)

- `PROFILE_MODERATION_BAN`: If set to `true`, the bot will automatically ban users that have a flagged profile, meaning
a suspicious username that might impersonate legitimate bots or users. Otherwise, only a log message is sent into the
`MODERATION_LOGS_CHANNEL`.

## Channel

- `MODERATION_LOGS_CHANNEL`: The channel where moderation logs are sent to. This includes all messages about warnings
and messages when a user is flagged.
- `SCORE_LOGS_CHANNEL`: The channel where special messages about the score system are sent to. This includes messages
when a log was denied by a staff member and when score is managed (using [](manage-score.topic)).
- `STRIKES_LOGS_CHANNEL`: The channel where strike logs are sent to, meaning messages when a warning with [type
`Strike`](Warning-Type.md) is added or edited.
- `LOG_APPROVING_CHANNEL`: `Coming soon`
- `TRANSCRIPTS_CHANNEL`: The channel where transcripts are sent to. If the server uses Ticket Tool, please make sure
that transcripts of all service tickets are sent to this channel. The bot will only listen to ticket transcripts in
this channel, other channels will be ignored.
- `TOTAL_SCORE_LEADERBOARD_CHANNEL`: The channel where the total score leaderboard is sent to. This leaderboard shows
the total score of all users in the server.
- `SERVICE_TEAM_RULES_CHANNEL`: `Coming soon`
- `CNT_MESSAGES_CHANNEL`: `Coming soon`
- `CNT_INFORMATION_CHANNEL`: `Coming soon`

## Category

`currently none`

## Role

- `SCORE_MANAGEMENT_ROLE`: The score management role affect which users are allowed to manage the score of other users
using the [](manage-score.topic) command. If a user does not have this role, they are not allowed to manage the score
of other users, and a warning message will be shown to them when using that command. If this property isn't set, the
user is required to have the `Administrator` permission to manage the score of other users. Additionally, this is
required to discard the `/log` message of other users.
36 changes: 28 additions & 8 deletions Writerside/topics/Warnings.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
# Warnings

Warnings are an easy way to log wrongful behavior of users, together with an automated way of punishing them based on the amount of warnings received.
Warnings are an easy way to log wrongful behavior of users, together with an automated way of punishing them based on
the amount of warnings received.

## Displaying your warnings

To display the active warns you currently have, you can use the command [](warns.topic).
> You need to have the `Moderate Members` permission to be able to see warns of other users through this command.
{style="note"}
> {style="note"}
To display all warns, even if they [were deactivated](warn-deactivate.topic), you can use the command [](warn-list-all.topic).
To display all warns, even if they [were deactivated](warn-deactivate.topic), you can use the
command [](warn-list-all.topic).

## Managing warnings
It's possible to manage warns using the command [](warn.topic). All warnings that are created have a unique numerical id that is used across all commands. \
When a warning is [given to a server member](warn-add.topic), [punishments](Warning-Punishment.md) can be automatically applied to the user.
> Currently, configuration of punishments is unavailable to server admins. If you wish to use them, please contact [the development team](mailto:[email protected])
{style="warning"}

[Punishments](Warning-Punishment.md) aren't updated/lifted when a warning is [deactivated](warn-deactivate.topic) or updated by an [evidence being added](warn-add-evidence.topic).
It's possible to manage warns using the command [](warn.topic). All warnings that are created have a unique numerical id
that is used across all commands. \
When a warning is [given to a server member](warn-add.topic), [punishments](Warning-Punishment.md) can be automatically
applied to the user.
> Currently, configuration of punishments is unavailable to server admins. If you wish to use them, please
> contact [the development team](mailto:[email protected])
> {style="warning"}
[Punishments](Warning-Punishment.md) aren't updated/lifted when a warning is [deactivated](warn-deactivate.topic) or
updated by an [evidence being added](warn-add-evidence.topic).

When warnings are edited, either by them being created, when an evidence is added or when they are deactivated, the
change is logged in the [respective channel](#log-channel).

## Log-Channel

When warnings are managed successfully, a log message containing the relevant information is sent into the log
channel. \
The log channel depends on the [](Warning-Type.md):
If the [warning type](Warning-Type.md) is either `Serious`, `Major` or `Minor`, the message is sent into the channel of
the [server property `MODERATION_LOGS_CHANNEL`](Server-Property.md), otherwise it's sent into the
[`STRIKES_LOGS_CHANNEL`](Server-Property.md).
9 changes: 9 additions & 0 deletions Writerside/topics/config.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="/config ✏️" id="config">

<code>Coming soon</code>
</topic>
58 changes: 56 additions & 2 deletions Writerside/topics/warn-add-evidence.topic
Original file line number Diff line number Diff line change
@@ -3,7 +3,61 @@
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="/warn add-evidence ✏️" id="warn-add-evidence">
title="/warn add-evidence" id="warn-add-evidence">

<code>Coming soon</code>
<tldr>
<p>
<format style="italic">Adds evidence to a warning.</format>
</p>
</tldr>

<chapter title="Examples" id="examples" collapsible="true">
<img alt="warn-add-evidence-1.png" src="warn-add-evidence-1.png" width="325" style="inline"
border-effect="rounded"/>
</chapter>

<chapter title="Description" id="description">
<p>This command adds evidence to a warning.</p>
<p>Please note that you should only supply either an attachment or a text, not both. If you supply both, only
the attachment will be added as an evidence, the text will be ignored.</p>
<p>You can read more about managing warnings <a href="Warnings.md" anchor="managing-warnings">here</a>.</p>
</chapter>

<chapter title="Arguments" id="arguments" collapsible="true">
<table style="header-row">
<tr>
<td>Name</td>
<td>Type</td>
<td>Description</td>
<td>Optional?</td>
<td>Additional</td>
</tr>

<tr>
<td><code>id</code></td>
<td>Number (long)</td>
<td>The id of the warning.</td>
<td>:x: No</td>
<td>
<list>
<li>Min value: 1</li>
</list>
</td>
</tr>

<tr>
<td><code>attachment</code></td>
<td>Attachment</td>
<td>Add an attachment (image or similar) as evidence.</td>
<td>:white_check_mark: Yes</td>
</tr>

<tr>
<td><code>text</code></td>
<td>String</td>
<td>Add a text (or link) as evidence.</td>
<td>:white_check_mark: Yes</td>
</tr>
</table>
</chapter>
</topic>
5 changes: 5 additions & 0 deletions Writerside/topics/warn-add.topic
Original file line number Diff line number Diff line change
@@ -18,6 +18,11 @@
<img alt="warn-add-dm.png" src="warn-add-dm.png" width="325" style="inline" border-effect="rounded"/>
</chapter>

<chapter title="Description" id="description">
<p>This command adds a warning to the given user. It also applies all available <a href="Warning-Punishment.md">punishments</a> to the user.</p>
<p>You can read more about managing warnings <a href="Warnings.md" anchor="managing-warnings">here</a>.</p>
</chapter>

<chapter title="Arguments" id="arguments" collapsible="true">
<table style="header-row">
<tr>
46 changes: 44 additions & 2 deletions Writerside/topics/warn-deactivate.topic
Original file line number Diff line number Diff line change
@@ -3,7 +3,49 @@
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="/warn deactivate ✏️" id="warn-deactivate">
title="/warn deactivate" id="warn-deactivate">

<code>Coming soon</code>
<tldr>
<p>
<format style="italic">Deactivate a given warning.</format>
</p>
</tldr>

<chapter title="Examples" id="examples" collapsible="true">
<img alt="warn-deactivate-1.png" src="warn-deactivate-1.png" width="325" style="inline"
border-effect="rounded"/>
<img alt="warn-deactivate-not-found.png" src="warn-deactivate-not-found.png" width="325" style="inline"
border-effect="rounded"/>
</chapter>

<chapter title="Description" id="description">
<p>This command deactivates a given warning.</p>
<p>This will mean that the warning will no longer be shown in <a href="warns.topic"/> and will no longer have an
effect when <a href="Warning-Punishment.md">punishments</a> are calculated.</p>
<p>You can read more about managing warnings <a href="Warnings.md" anchor="managing-warnings">here</a>.</p>
</chapter>

<chapter title="Arguments" id="arguments" collapsible="true">
<table style="header-row">
<tr>
<td>Name</td>
<td>Type</td>
<td>Description</td>
<td>Optional?</td>
<td>Additional</td>
</tr>

<tr>
<td><code>id</code></td>
<td>Number (long)</td>
<td>The id of the warning.</td>
<td>:x: No</td>
<td>
<list>
<li>Min value: 1</li>
</list>
</td>
</tr>
</table>
</chapter>
</topic>