# Templates

You can use txt files to describe the logout message a player will see when he gets banned.\
By default this entire functionality is disabled. To enable templates do the following.

### Setup

Inside the Staff++ plugin directory create a **bans** directory if it does not already exists.\
\
Inside this bans directory you can create the template files. A template file is a simple text file containing the message that will displayed to the user on ban. Example file:

{% file src="/files/-MW6p7-bk759j2hyKOEZ" %}
bans/default.txt
{% endfile %}

I named the above file **default.txt.** The file name without extension will be used as **template name**.<br>

This will result in the following:

![](/files/-MW6q6iGCsvw71M8Nu1u)

My example is not that pretty but it illustrates the usage.<br>

#### placeholders

Inside the template the following placeholders can be used

| placeholder | description                                           |
| ----------- | ----------------------------------------------------- |
| %target%    | The banned player's username                          |
| %issuer%    | The staff members username                            |
| %reason%    | The ban reason                                        |
| %duration%  | Human readable duration. Only available with tempbans |

### Configuration

```yaml
ban-module:
  enabled: true
  permban-template: default
  tempban-template: default
```

Inside the **config.yml** file you can fill in a default template for permanent and temporary ban. Or leave it empty to fall back on the message defined in the lang file.

### Overwriting the default template

If staff members have the permission: `staff.bans.ban-template-overwrite` they can use an extra parameter **"-template="** when banning a player.\
Example:\
`/ban thisplayer -template=other I ban you!`

This will overwrite the default configured template and try to find and use a template with the given name. If the template does not exist an error will be shown.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.staffplusplus.org/features/banning/templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
