Skip to content

Commit d587f24

Browse files
committed
docs: fix broken link
1 parent fb7afc7 commit d587f24

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

docs/docs/examples/_category_.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"label": "Example",
3+
"position": 5,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "5 minutes to learn the most important SwiBots concepts."
7+
},
8+
"collapsed": true
9+
10+
}

docs/docs/examples/echo-bot.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Creating Your First Bot: Echo Bot
2+
3+
In this example, we'll create a simple echo bot using SwiBots. This bot will respond to any message it receives by sending the same message back to the user.
4+
5+
## Prerequisites
6+
7+
Before you begin, make sure you have:
8+
9+
1. Installed SwiBots (`pip install swibots`)
10+
2. Obtained a bot token from the Switch platform
11+
12+
## The Code
13+
14+
Here's the complete code for our echo bot:
15+
16+
```python
17+
from swibots import Client, BotContext, MessageEvent
18+
19+
app = Client("YOUR_BOT_TOKEN")
20+
21+
@app.on_message()
22+
async def message_handler(ctx: BotContext[MessageEvent]):
23+
message = ctx.event.message
24+
await message.respond(f"Received: {message.message}")
25+
26+
27+
app.run()
28+
```
29+
30+
## Running the Bot
31+
32+
To run the bot, simply execute the script:
33+
34+
```bash
35+
python echo_bot.py
36+
```
37+
38+
## Testing the Bot
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"label": "Fundamentals",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "5 minutes to learn the most important SwiBots concepts."
7+
},
8+
"collapsed": true
9+
10+
}

0 commit comments

Comments
 (0)