This commit is contained in:
56
stbf-demo/README.MD
Normal file
56
stbf-demo/README.MD
Normal file
@@ -0,0 +1,56 @@
|
||||
## Демо приложение
|
||||
|
||||
Позволяет запустить простого бота, который будет отвечать на заранее определенные команды,
|
||||
без программирования логики.
|
||||
|
||||
### Запуск
|
||||
|
||||
Собрать fat-jar
|
||||
|
||||
```shell
|
||||
mvn package
|
||||
```
|
||||
|
||||
Запустить
|
||||
|
||||
```shell
|
||||
java -jar stbf-demo.jar -t <bot:token> -f <полный путь к конфигу>
|
||||
```
|
||||
|
||||
### Файл конфигурации
|
||||
|
||||
Если запустить без указания файла конфигурации бота, то будет использована следующая:
|
||||
|
||||
```xml
|
||||
|
||||
<flow>
|
||||
<actions>
|
||||
<action id="10001" name="start-action" command="/start">Start</action>
|
||||
<action id="10002" name="help-action" command="/help">Help</action>
|
||||
</actions>
|
||||
<screens>
|
||||
<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>
|
||||
<screen id="20001" name="on-help-screen">
|
||||
<text>This is demo help</text>
|
||||
<keyboard>
|
||||
<row>
|
||||
<button actionRef="help-action">Action.name</button>
|
||||
</row>
|
||||
</keyboard>
|
||||
</screen>
|
||||
</screens>
|
||||
<commands>
|
||||
<command actionRef="start-action" screenRef="on-start-screen" id="30001" name="startCommand"/>
|
||||
<command actionRef="help-action" screenRef="on-help-screen" id="30002" name="helpCommand"/>
|
||||
</commands>
|
||||
</flow>
|
||||
```
|
||||
|
||||
Ее можно использовать как базу для разработки своей.
|
||||
Reference in New Issue
Block a user