Member Attributes
Member Attributes is a data storage used to store any information related to a specific member.
They are represented by getAttribute method and attributes property of Member data type.
WARNING
You can only access 5 attributes in single message template.
Active Bonus on the server increases this limit up to 10 attributes.
Saving Data
In order to save any data into attributes, you should use update method:
{% do member.getAttribute('example').update('Hello World!') %}
You can increment or decrement attribute's number value by specified amount using increment and decrement methods:
Incrementing value:
{% do member.getAttribute('example').increment(1) %}
Decrementing value:
{% do member.getAttribute('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
Attributes are stored indefinitely and can be accessed as follows:
{{ member.getAttribute('example').value }}
Clearing Data
In order to clear attribute use clear method:
{% do member.getAttribute('example').clear() %}
You can also clear attributes with specified key for all members on the server using clearAttributes method of Guild data type:
{% do guild.clearAttributes('example') %}
If you want to clear every single attribute from the server, use clearAllAttributes method of Guild data type:
{% do guild.clearAttributes() %}