File tree Expand file tree Collapse file tree 4 files changed +63
-2
lines changed
Expand file tree Collapse file tree 4 files changed +63
-2
lines changed Original file line number Diff line number Diff line change 1+ # Bot API
2+
3+ This module containes the base class for all bots ` BaseBot ` but also
4+ specialized implementations such as ` DesktopBot ` which is described below.
5+
6+ You are expected to implement the ` action ` method of the ` DesktopBot ` class in
7+ your Bot class.
8+
9+ Here is a very brief example of a bot which opens the BotCity website:
10+
11+ ``` python
12+ from botcity.core import DesktopBot
13+
14+
15+ class Bot (DesktopBot ):
16+ def action (self , execution ):
17+ # Opens the BotCity website.
18+ self .browse(" https://botcity.dev/en" )
19+
20+
21+ if __name__ == ' __main__' :
22+ Bot.main()
23+ ```
24+
25+
26+ All functions from the API described below are accessible via the bot class as
27+ methods without the need to import any other module.
28+
29+ E.g.:
30+
31+ ``` python
32+ class Bot (DesktopBot ):
33+ def action (self , execution ):
34+ # using browse from browser module
35+ self .browse(... )
36+ # using find from display module
37+ self .find(... )
38+ # using mouse_move from mouse module
39+ self .mouse_move(x = 100 , y = 200 )
40+ # using enter from keyboard module
41+ self .enter()
42+
43+ ```
44+
45+ ## DesktopBot API
46+
47+ ::: botcity.core.bot.DesktopBot
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ The API is divided into the following modules:
1212
1313- * misc* : this module contains miscellaneous functions such as executing applications, and wait/print.
1414
15+ - * bot* : this module contains the base class for Bots, including the DesktopBot
1516
1617In order to make it easy for users, all modules are available
1718via the core module.
Original file line number Diff line number Diff line change @@ -19,7 +19,15 @@ which takes as argument a URL.
1919browser(" https://www.botcity.dev/en" )
2020```
2121
22+ ## Template Project
23+
24+ We created a template project using Cookiecutter to help
25+ you create new bots using BotCity's Python Framework.
26+
27+ Take a look into the [ template project website] ( https://github.com/botcity-dev/bot-python-template ) for more information
28+ on how to use it and get started.
29+
2230## Next Steps
2331
24- Check our example and experiment with the API.
25- Let us know where it can be improved.
32+ Check our examples and experiment with the API.
33+ Let us know where it can be improved.
Original file line number Diff line number Diff line change 1313 - ' Mouse ' : api/mouse.md
1414 - ' Keyboard ' : api/keyboard.md
1515 - ' Misc ' : api/misc.md
16+ - ' Bot ' : api/bot.md
1617theme :
1718 icon :
1819 repo : fontawesome/brands/github
@@ -35,6 +36,10 @@ theme:
3536 icon : material/toggle-switch
3637 name : Switch to light mode
3738
39+ markdown_extensions :
40+ - pymdownx.highlight
41+ - pymdownx.superfences
42+
3843extra :
3944 generator : false
4045 social :
You can’t perform that action at this time.
0 commit comments