> For the complete documentation index, see [llms.txt](https://smuddgge.gitbook.io/leaf-3.3.0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smuddgge.gitbook.io/leaf-3.3.0/commands/message-types/messagehistory.md).

# messagehistory

Similar to core protect, it lets you see the player's message history.

{% code title="Example" overflow="wrap" %}

```yaml
message_history:
  type: "messagehistory"
  enabled: true
  name: "messagehistory"
  not_found: "{error_colour}Player could not be found."
  # Amount of sections on a page.
  page_size: 8
  # %page% : The number of the page the player is currently viewing.
  # %page_amount% : The amount of pages they can see.
  header: '&8&m&l------&r &a&lMessages &7[&f%page%&7/&f%page_amount%&7] &8&m&l------'
  # %message% : The content of the message.
  # %from% : The player the message was from.
  # %to% :  player the message was sent to.
  # %date% : The date the message was sent.
  section: '&7%date% &f%from% &7: &e%message%'
  # %page% : The number of the page the player is currently viewing.
  # %page_amount% : The amount of pages they can see.
  footer: '&8&m&l---------------------'
```

{% endcode %}

`/[name] [query]`

{% tabs %}
{% tab title="Example 1" %}

```
/messagehistory p:Smudge t:10d i:"Hi!" e:"Bye","Byebye"
```

{% endtab %}

{% tab title="Example 2" %}

```
/messagehistory p:Smudge,Smudge2 t:1d-2d
```

{% endtab %}
{% endtabs %}

**Query Types**\
`p:` Is used to include a player or players.\
`t:` Is used to specify a time period.\
`i:` is used to only show messages that include the strings.\
`e:` is used to remove messages that include this string.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://smuddgge.gitbook.io/leaf-3.3.0/commands/message-types/messagehistory.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.
