Skip to content

Commit

Permalink
update docs style
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfcabral committed Mar 18, 2024
1 parent 760ae18 commit ab9302b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 12 deletions.
73 changes: 61 additions & 12 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,66 @@
# Welcome to MkDocs
# Welcome to Botgen

For full documentation visit [mkdocs.org](https://www.mkdocs.org).
- [Documentation](https://jpfcabral.github.io/botgen/)
- [Source code](https://github.com/jpfcabral/botgen)

## Commands
*Python-based open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.*

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
This repository is inspired by the javascript library [Botkit](https://github.com/howdyai/botgen) and the [BotFramework SDK](https://github.com/microsoft/botframework-sdk) concepts.

## Project layout
### Adapters

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
You can connect major plataforms using the same bot core code by setting different adapters. Adapter is a interface between your bot and message plataforms.


| Adapter | Docs | Availability |
|---------| -----|--------------|
| Web | | 0.0.1 |
| Telegram | | |
| Discord | | |
| Slack | | |
| Facebook | | |
| Twilio (SMS) | | |
| Whatsapp | | |

### Usage

Installation

`pip install botgen`

Copy and paste the code below to a file called `run.py`

```python
# run.py
from botgen import Bot
from botgen import BotMessage
from botgen import BotWorker
from botgen.adapters import WebAdapter

adapter = WebAdapter()
bot = Bot(adapter=adapter)

async def hello(bot_worker: BotWorker, message: BotMessage):
await bot_worker.say("hello from bot")


bot.hears(pattern="hello", event="message", handler=hello)

bot.start()
```

So you can run the project using:

`python run.py`

Then start a conversation:

```bash
curl -L -X POST 'http://localhost:8080/api/messages' -H 'Content-Type: application/json' -d '{
"user": "dummy",
"text": "hello",
"type": "message"
}'
```

### How to contribute
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ site_name: Botgen
nav:
- Home: index.md
- Introduction: intro.md
- Conversation: conversation.md

theme:
name: material

0 comments on commit ab9302b

Please sign in to comment.