User functions

Function

Description

User.setProperty(name, value, type)

Set property with name for user. Name is case sensitive. Read more

User.setProperty("city", "London", "string")

Type can be: integer, float, string, text, json, datetime

User.getProperty(name)

Read property with name. Name is case sensitive. Read more

User.getProperty("city") can get property with default value for non exist property:

User.getProperty("city", "London")

can get property of another bot:

Bot.getProperty({ name: "propName", other_bot_id: OTHER_BOT_ID })

User.addToGroup(group_name)

Add user to group with group_name

User.addToGroup("guests")

User.getGroup()

Get current user's group

User.removeGroup()

Remove user from current group

Access to property in answer:

You can also use the properties in the command's answer. For example, you can do this with the / hello command:Hello, <UserRole>!

in BJS:

And you can use it in Bot.sendMessage("Hello, <UserRole>")

Last updated