@@ -8,7 +8,7 @@ when connected to a {{ project.name }} instance instead.
88
99Below are some popular libraries for connecting bots to a {{ project.name }} instance.
1010
11- Make sure to replace ` api.{{ project.domain }} ` and ` cdn.{{ project.domain }} `
11+ Make sure to replace ` api.rory.server. {{ project.domain }} ` and ` cdn.rory.server .{{ project.domain }} `
1212with the appropriate URLs of the instance you want to connect to.
1313
1414You can get them from a client or from the [ well-known] ( ../server/wellknown ) instance endpoint.
@@ -23,8 +23,8 @@ const { Client } = require("discord.js");
2323
2424const client = new Client ({
2525 rest: {
26- api: " https://api.{{ project.domain }}/api" ,
27- cdn: " https://cdn.{{ project.domain }}" ,
26+ api: " https://api.rory.server. {{ project.domain }}/api" ,
27+ cdn: " https://cdn.rory.server. {{ project.domain }}" ,
2828 version: " 9"
2929 },
3030 ws: {
@@ -45,7 +45,7 @@ const bot = new Eris("your token here", {
4545 " guildMessages"
4646 ],
4747 rest: {
48- domain: " api.old. server.spacebar.chat " ,
48+ domain: " rory. server.{{ project.domain }} " ,
4949 baseURL: " /api/v9"
5050 },
5151 ws: {
@@ -64,7 +64,7 @@ bot.connect();
6464``` py
6565import discord
6666
67- discord.http.Route.BASE = " https://api .{{ project.domain }} /api"
67+ discord.http.Route.BASE = " https://rory.server .{{ project.domain }} /api"
6868client = discord.Client()
6969
7070client.run(" your token here" )
@@ -73,14 +73,14 @@ client.run("your token here")
7373### JDA
7474
75751 . Create a RestConfig instance: ` RestConfig restConfig = new RestConfig(); `
76- 2 . Use RestConfig#setBaseUrl to tell JDA what your Rest URI is: ` restConfig.setBaseUrl("https://api .{{ project.domain }}/api/v9"); `
76+ 2 . Use RestConfig#setBaseUrl to tell JDA what your Rest URI is: ` restConfig.setBaseUrl("https://rory.server .{{ project.domain }}/api/v9"); `
77773 . Create another class, and extend ConcurrentSessionController, e.g. ` public class SpacebarSessionController extends ConcurrentSessionController `
78784 . Override the ConcurrentSessionController#getGateway method:
7979``` java
8080 @NotNull
8181 @Override
8282 public String getGateway() {
83- return " wss://gateway.{{ project.domain }}/?encoding=json&v=9&compress=zlib-stream" ;
83+ return " wss://gateway.rory.server. {{ project.domain }}/?encoding=json&v=9&compress=zlib-stream" ;
8484 }
8585```
86865 . Finally, configure JDA to use your RestConfig & SpacebarSessionController, like this:
0 commit comments