Skip to content

Commit 9b4a938

Browse files
committed
docs: update readme
1 parent 3fa6577 commit 9b4a938

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
# FastAPI wrapper for interactions.py
1+
# interactions restful
22

3-
An Extension library to add restful API for your interactions.py bot.
3+
A library for interactions.py allowing runtime API structures
44

55
## Installation
66

7-
``pip install interactions-restful``
7+
Using pip:
8+
`pip install interactions-restful`
9+
10+
Using poetry:
11+
`poetry add interactions-restful`
12+
13+
Don't forget to specify backend you want to use:
14+
- flask `pip install interactions-restful[flask]`
15+
- fastapi `pip install interactions-restful[fastapi]`
816

917
## Simple example
1018

1119
### Main file
1220

1321
```python
1422
import interactions
15-
from interactions_restful import APIExtension
23+
from interactions_restful import setup
24+
from interactions_restful.backends.fast_api import FastAPI
1625

1726
client = interactions.Client()
1827

19-
APIExtension(client, "127.0.0.1", 5000, "flask")
28+
setup(client, FastAPI, "127.0.0.1", 5000)
2029

2130
client.load_extension("api")
2231

@@ -34,13 +43,17 @@ from interactions_restful import route
3443
class MyAPI(interactions.Extension):
3544
@route("GET", "/")
3645
def index(self):
37-
return {"status": "success"}
46+
return {"status": "Hello, i.py"}
47+
48+
@interactions.slash_command()
49+
async def test_command(self, ctx):
50+
await ctx.send("Hello, API")
3851

3952
```
4053

41-
## Modes
54+
## Backends
4255

43-
Extension support both flask and fastapi as backend for building an api, but if you don't want to use them you could create own backend.
56+
Currently, library support only flask and fastapi as a backend for building an api, but if you don't want to use them you can create own backend.
4457

4558
## Documentation
4659

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ line_length = 100
99
[tool.poetry]
1010
name = "interactions-restful"
1111
version = "1.0.0"
12-
description = "An extension library for interactions.py allowing runtime API structures"
12+
description = "A library for interactions.py allowing runtime API structures"
1313
authors = ["Damego <[email protected]>"]
1414
license = "MIT"
1515
readme = "README.md"

0 commit comments

Comments
 (0)