Skip to content

Commit ca3a5ce

Browse files
authored
Update README.md
1 parent 582a3de commit ca3a5ce

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,40 @@ hikari-clusters allows you to scale your Discord bots horizontally by using mult
88

99
See the #clusters channel in the hikari-py discord for help.
1010

11+
```py
12+
# brain.py
13+
from hikari_clusters import Brain
14+
15+
Brain(
16+
host="localhost",
17+
port=8765,
18+
token="ipc token",
19+
total_servers=1,
20+
clusters_per_server=2,
21+
shards_per_cluster=3,
22+
).run()
23+
```
24+
```py
25+
# server.py
26+
from hikari import GatewayBot
27+
from hikari_clusters import Cluster, ClusterLauncher, Server
28+
29+
class MyBot(GatewayBot):
30+
cluster: Cluster
31+
32+
def __init__(self):
33+
super().__init__(token="discord token")
34+
35+
# load modules & events here
36+
37+
Server(
38+
host="localhost",
39+
port=8765,
40+
token="ipc token",
41+
cluster_launcher=ClusterLauncher(MyBot),
42+
).run()
43+
```
44+
1145
Run examples with `python -m examples.<example name>` (`python -m examples.basic`)
1246

1347
<p align="center">

0 commit comments

Comments
 (0)