Files
stbf/stbf-templates/README.MD
Ruslan Penkrat 932da0549a
All checks were successful
continuous-integration/drone/push Build is passing
add readme
2021-09-05 13:03:47 +03:00

58 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Поддержка шаблонов и конфигурации
### Основные секции
```xml
<flow>
<actions> </actions>
<screens> </screens>
<commands> </commands>
</flow>
```
### Actions
Action - Это действие пользователя бота, которое бот должен обработать
```xml
<action id="10002" name="help-action" command="/help">Help</action>
```
`id`, `name` - идентификаторы узла (экшена)
`command` - команда Telegram, должна начинаться со знака "/"
содержимое тега - вводимый текст, используется как экранная кнопка
### Screens
Screen - то, что бот ответит пользователю,
обычно текст и набор кнопок с действиями.
```xml
<screen id="20001" name="on-start-screen">
<text>This is demo bot</text>
<keyboard>
<row>
<button actionRef="help-action">Action.name</button>
</row>
</keyboard>
</screen>
```
`text` - выводимый текст
`keyboard` - описание клавиатуры
### Commands
Простая команда, при соверщении action будет выведен screen
```xml
<command actionRef="start-action" screenRef="on-start-screen" id="30001" name="startCommand"/>
```
`actionRef` - ссылка на action, может использоваться id или name
`screenRef` - ссылка на screen, может использоваться id или name