Last updated
Last updated
You can create a custom admin panel.
make custom data fields: numeric, text, checkbox, password
data fields will be accessible in BJS
admin panels can be created via BJS
bot run customized command on field saving
supports severals panels with titles and differents fields
Benefits:
making options for saving any api keys, secure and unsecure data
can run any BJS logic from panel. For example: it will be possible create text field with button "Send this message to all chats" from App.
make any quick statistic and information. Bot dashboards and etc
Admin Panel - this is a combination of several panels. Each panel have title, icon, description and one or more fields:
For adding panel:
AdminPanel.setPanel({ panel_name: PANEL_NAME, data: PANEL_OPTIONS });
PANEL_OPTIONS - it is JSON option for this panel
Example
Default is false. All old values for the fields are retained.
If true - all old values for fields are reassigned.
It is array of fields. One panel can have several fields. It is also possible panel without any field.
Fields can have name, value, title, description, type, placeholder and icon
Use this method for getting one value from panel
Use this method for setting one value to panel
Use this method for getting several/all values from panel
Use admin panels to create a configuration
Define Admin Panels in /config
command with AdminPanel.setPanel
method.
Then use AdminPanel.getPanelValue
method for getting any field's value
Use admin panels to create a bot dashboard
Panel without fields can dispay any informations. Use this.
Use admin panels to create admin reactions
You can launch any bot command on panel saving. It is good for making any admin command execution. Use on_saving
:
You can use all icons from
Type
Description
checkbox
Text input
integer
Text input
float
Text input
string
Text input
password
Password input
text
Text field