---
url: https://docs.juniper.bot/en/message-templates/persistence/member-attributes.md
description: Data Persistence guide for Member Attributes
---

[Number]: /en/message-templates/types/index#literals

[String]: /en/message-templates/types/index#literals

[Boolean]: /en/message-templates/types/index#literals

[List]: /en/message-templates/types/index#lists

[Map]: /en/message-templates/types/index#maps

[DateTime]: /en/message-templates/types/index#datetime

[TwitchChannel]: /en/message-templates/types/subscriptions/twitch#twitch-channel

[TwitchStream]: /en/message-templates/types/subscriptions/twitch#twitch-stream

[TwitchGame]: /en/message-templates/types/subscriptions/twitch#twitch-game

[YouTubeChannel]: /en/message-templates/types/subscriptions/youtube#youtube-channel

[YouTubeVideo]: /en/message-templates/types/subscriptions/youtube#youtube-video

[VkWallPost]: /en/message-templates/types/subscriptions/vk#vkwallpost

[Rank]: /en/message-templates/types/discord/rank

[Guild]: /en/message-templates/types/discord/guild

[Member]: /en/message-templates/types/discord/member

[Role]: /en/message-templates/types/discord/role

[Message]: /en/message-templates/types/discord/message

[Attachment]: /en/message-templates/types/discord/attachment

[Embed]: /en/message-templates/types/discord/embed

[Activity]: /en/message-templates/types/discord/activity

[MemberVoiceState]: /en/message-templates/types/discord/member-voice-state

[MemberPrimaryGuild]: /en/message-templates/types/discord/member-primary-guild

[MenuBuilder]: /en/message-templates/types/discord/menu-builder

[UserFlag]: /en/message-templates/types/discord/user-flag

[Permission]: /en/message-templates/types/discord/permission

[Category]: /en/message-templates/types/discord/category

[TextChannel]: /en/message-templates/types/discord/text-channel

[VoiceChannel]: /en/message-templates/types/discord/voice-channel

[NewsChannel]: /en/message-templates/types/discord/news-channel

[StageChannel]: /en/message-templates/types/discord/stage-channel

[ForumChannel]: /en/message-templates/types/discord/forum-channel

[MediaChannel]: /en/message-templates/types/discord/media-channel

[ThreadChannel]: /en/message-templates/types/discord/thread-channel

[Page]: /en/message-templates/types/storage/page

[GuildIndex]: /en/message-templates/types/storage/guild-index

[GuildIndexEntry]: /en/message-templates/types/storage/guild-index-entry

[GuildIndexes]: /en/message-templates/types/storage/guild-indexes

[MemberAttribute]: /en/message-templates/types/storage/member-attribute

[MemberAttributes]: /en/message-templates/types/storage/member-attributes

[Arguments]: /en/message-templates/types/custom-commands/arguments

[Parameters]: /en/message-templates/types/custom-commands/parameters

[Component]: /en/message-templates/types/custom-commands/component

[Modal]: /en/message-templates/types/custom-commands/modal

# Member Attributes { #member-attributes }

Member Attributes is a data storage used to store any information related to a specific member.

They are represented by [`getAttribute`](../types/discord/member#method-getattribute) method and
[`attributes`](../types/storage/member-attributes) property of \[Member] data type.

::: warning
You can only access 5 attributes in single message template.

[Active Bonus](https://juniper.bot/donate) on the server increases this limit up to 10 attributes.
:::

## Saving Data { #saving }

In order to save any data into attributes, you should use [`update`](../types/storage/member-attribute#method-update) method:

::: tabs

\== Method | mdi-code-parentheses

```template
{% do member.getAttribute('example').update('Hello World!') %}
```

\== Property | mdi-alphabet-latin

This option is only available if attribute key is a valid [identifier](../advanced/expressions#identifiers):

```template
{% do member.attributes.example.update('Hello World!') %}
```

:::

You can increment or decrement attribute's number value by specified amount using
[`increment`](../types/storage/member-attribute#method-increment)
and [`decrement`](../types/storage/member-attribute#method-decrement) methods:

::: tabs

\== Method | mdi-code-parentheses

Incrementing value:

```template
{% do member.getAttribute('example').increment(1) %}
```

Decrementing value:

```template
{% do member.getAttribute('example').decrement(1) %}
```

\== Property | mdi-alphabet-latin

This option is only available if attribute key is a valid [identifier](../advanced/expressions#identifiers):

Incrementing value:

```template
{% do member.attributes.example.increment(1) %}
```

Decrementing value:

```template
{% do member.attributes.example.decrement(1) %}
```

:::

::: info
If you want to store data that isn't tied to a specific member, you can use the bot's own attributes.
They can be accessed through the predefined `bot` variable instead of `member`.
:::

## Accessing Data { #accessing }

Attributes are stored indefinitely and can be accessed as follows:

::: tabs

\== Method | mdi-code-parentheses

```template
{{ member.getAttribute('example').value }}
```

\== Property | mdi-alphabet-latin

This option is only available if attribute key is a valid [identifier](../advanced/expressions#identifiers):

```template
{{ member.attributes.example.value }}
```

:::

## Clearing Data { #clearing }

In order to clear attribute use [`clear`](../types/storage/member-attribute#method-clear) method:

::: tabs

\== Method | mdi-code-parentheses

```template
{% do member.getAttribute('example').clear() %}
```

\== Property | mdi-alphabet-latin

This option is only available if attribute key is a valid [identifier](../advanced/expressions#identifiers):

```template
{% do member.attributes.example.clear() %}
```

:::

You can also clear attributes with specified key for all members on the server using
[`clearAttributes`](../types/discord/guild#method-clearattributes) method of \[Guild] data type:

```template
{% do guild.clearAttributes('example') %}
```

If you want to clear every single attribute from the server, use
[`clearAllAttributes`](../types/discord/guild#method-clearallattributes) method of \[Guild] data type:

```template
{% do guild.clearAttributes() %}
```
