Skip to content
Docs
Modules Constructor

Resources and the module form

{{name}} resources in the Multogram Modules Constructor — the fields of a module's settings form: field types, required fields, groups in the layout manager, visibility conditions, translations, test values and the account picker field.

A resource is a setting the module's user sets before running: a chat, a text, a delay, a file with a list of targets. The module form is built from resources automatically — the user sees it in the new task window — and the scenario reads the values as {{name}}.

Resource or variable?

A resource is what the user chooses before running. A variable is what the scenario computes by itself. Don't make a resource out of a value the user doesn't need to change.

Resources panel

The panel on the right shows the module's resources: name, type, current value and description.

ElementWhat it does
SearchFind a resource by name
Add ResourceCreate a form field
Layout ManagerArrange the fields into groups and columns
Set ValuesValues for tests

Each resource has edit and delete buttons. The Preview button in the top bar shows the form the way the user will see it.

Account picker field

The accounts resource is created in every new module by itself: it is the choice of accounts from the Multogram database. It is protected — it can't be changed or deleted — and in the module form it is labeled Accounts.

The scenario gets the selected accounts as a list. Each item is an account with these fields:

FieldWhat's in it
phoneThe account's phone number
session_pathThe path to the .session session file
data_pathThe path to the .json data file
proxyThe account's proxy: type, host, port, username, password and url — a string like socks5://user:pass@host:port. If there is no proxy — null

The proxy fields are inserted into actions where a proxy is set in parts: [[account]].proxy.host, [[account]].proxy.port. This is how Start Session in the AuthSession function and Set Proxy of the TLS Client module do it. How to hand accounts out to threads is in Threads and accounts.

Creating a resource

FieldWhat to enter
NameThe name for the scenario: Latin letters and digits, {{chat}}
TitleThe field's label in the form and its translations
DescriptionAn explanation under the field
TypeThe kind of field — see the table below

The other sections of the window depend on the type: Appearance, Options, Constraints (minimum, maximum, length), Value & Behavior (default value, required field), Placeholder, Visibility and Value Parsing.

Field types

TypeWhat forView options
StringText, a link, @usernameSingle-line and multi-line field, tags (a list of values), a random string generator from a pattern
NumberA delay, a limit, a quantityField, slider, a "from — to" range
Path PickerA file or folder on diskFile path, folder path, file content (the file's text goes into the value)
Checkbox ListSeveral options — or an on/off switchCheckboxes, switch, cards
Radio ListOne option, all visible at onceButtons, cards
Select ListOne option from a drop-down listList, cards
Date/TimeA date, a time, a periodDate, time, date and time, date range
ColorA colorHEX or RGB, with transparency
EmojiA reaction, emoji for textLimits on number and set

Choose the type by meaning

"Delete the message after sending" is a Checkbox List shown as a switch, not a "yes/no" string. A "from and to" delay is a Number shown as a range. Then the form is clear, and the value unambiguous.

Values in the scenario

{{name}} inserts a resource's value into any field of an action, just as [[name]] inserts a variable.

ValueHow to read it
Simple: text, a number{{message}}, {{delay}}
A range{{delay}}.min and {{delay}}.max
A list: checkboxes, tags, file linesAs a whole — into a FOREACH loop ({{targets}}), one at a time — with the Get Resource Value action and its Take Item parameter

To take apart a complex value, save it to a variable or use the JSON module.

Groups and layout

The Layout Manager arranges the fields into groups: a column, a row or a grid, with or without a title, a collapsible group for rarely used settings. On the right is a live preview of the form.

Groups are worth creating when there are more than five or six fields and they fall into topics: "Targets", "Texts", "Delays".

Conditional visibility

In the Visibility section a field gets a condition: show it only when another field has the right value. For example, the "Reply text" field is visible only if the "Reply to messages" switch is on. There can be several conditions: Match all (AND) or Match any (OR).

Translations

Title is the field's label in the form. The Manage Translations button next to it sets the text for Multogram's languages: English, Russian, Ukrainian, Chinese and Hindi. Descriptions, placeholders and choice options are translated the same way. If there is no translation, English is shown.

Values for tests

Set Values opens all resources with their current values — set the data for tests here. For accounts, give test rows: the paths to a test account's files.

Values aren't saved in the project

The project stores the resource's description and its default value, but not the current value. After reopening the project, set the test values again.

Resources at runtime

The Resources module reads and changes resources right while the module runs: Get Resource Value (as a whole or one list item at a time), Set Resource Value (replace or add an item to a list), Create Resource, Delete Resource, Get All Resources.

Updated

CookiesPrivacy Policy

We use essential cookies to run this site. With your consent, we will also use analytics cookies to improve it and marketing cookies to credit whoever referred you. You can change your choice at any time.