diff --git a/d2m/discord-client.js b/d2m/discord-client.js index b1a1e811..6597889d 100644 --- a/d2m/discord-client.js +++ b/d2m/discord-client.js @@ -1,8 +1,12 @@ // @ts-check -const { SnowTransfer } = require("snowtransfer") +const registration = require("../matrix/read-registration") +const { Endpoints, SnowTransfer } = require("snowtransfer") const { Client: CloudStorm } = require("cloudstorm") +// @ts-ignore +Endpoints.BASE_HOST = registration.ooye.discord_origin; Endpoints.CDN_URL = registration.ooye.discord_cdn_origin + const passthrough = require("../passthrough") const { sync } = passthrough diff --git a/registration.example.yaml b/registration.example.yaml index 9e7cd2c5..879081d6 100644 --- a/registration.example.yaml +++ b/registration.example.yaml @@ -18,6 +18,8 @@ ooye: max_file_size: 5000000 server_name: [the part after the colon in your matrix id, like cadence.moe] server_origin: [the full protocol and domain of your actual matrix server's location, with no trailing slash, like https://matrix.cadence.moe] + discord_origin: https://discord.com + discord_cdn_origin: https://cdn.discordapp.com invite: # uncomment this to auto-invite the named user to newly created spaces and mark them as admin (PL 100) everywhere # - @cadence:cadence.moe diff --git a/types.d.ts b/types.d.ts index e93f3790..656c22ae 100644 --- a/types.d.ts +++ b/types.d.ts @@ -21,6 +21,8 @@ export type AppServiceRegistrationConfig = { max_file_size: number server_name: string server_origin: string + discord_origin: string + discord_cdn_origin: string invite: string[] } old_bridge?: {