File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,40 @@ hikari-clusters allows you to scale your Discord bots horizontally by using mult
88
99See 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+
1145Run examples with ` python -m examples.<example name> ` (` python -m examples.basic ` )
1246
1347<p align =" center " >
You can’t perform that action at this time.
0 commit comments