From bf33c9874b87327d11e7f3152feb6866e466777e Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 23 Oct 2025 14:04:08 +0200 Subject: [PATCH] Move region to webrtc schemas --- src/gateway/opcodes/VoiceStateUpdate.ts | 4 ++-- .../region => schemas/webrtc}/Region.ts | 0 src/schemas/webrtc/index.ts | 2 ++ src/util/config/types/RegionConfiguration.ts | 2 +- .../config/types/subconfigurations/index.ts | 1 - .../types/subconfigurations/region/index.ts | 19 ------------------- 6 files changed, 5 insertions(+), 23 deletions(-) rename src/{util/config/types/subconfigurations/region => schemas/webrtc}/Region.ts (100%) delete mode 100644 src/util/config/types/subconfigurations/region/index.ts diff --git a/src/gateway/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts index a2922e0ce..ea7f29e0d 100644 --- a/src/gateway/opcodes/VoiceStateUpdate.ts +++ b/src/gateway/opcodes/VoiceStateUpdate.ts @@ -17,10 +17,10 @@ */ import { Payload, WebSocket } from "@spacebar/gateway"; -import { Config, emitEvent, Guild, Member, Region, VoiceServerUpdateEvent, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util"; +import { Config, emitEvent, Guild, Member, VoiceServerUpdateEvent, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util"; import { genVoiceToken } from "../util/SessionUtils"; import { check } from "./instanceOf"; -import { VoiceStateUpdateSchema } from "@spacebar/schemas"; +import { Region, VoiceStateUpdateSchema } from "@spacebar/schemas"; // TODO: check if a voice server is setup // Notice: Bot users respect the voice channel's user limit, if set. diff --git a/src/util/config/types/subconfigurations/region/Region.ts b/src/schemas/webrtc/Region.ts similarity index 100% rename from src/util/config/types/subconfigurations/region/Region.ts rename to src/schemas/webrtc/Region.ts diff --git a/src/schemas/webrtc/index.ts b/src/schemas/webrtc/index.ts index 7be4af62f..b25b57dfe 100644 --- a/src/schemas/webrtc/index.ts +++ b/src/schemas/webrtc/index.ts @@ -15,5 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + export * from "./VoiceIdentifySchema"; export * from "./VoiceVideoSchema"; +export * from "./Region" \ No newline at end of file diff --git a/src/util/config/types/RegionConfiguration.ts b/src/util/config/types/RegionConfiguration.ts index 8cd11fc04..b6c11b075 100644 --- a/src/util/config/types/RegionConfiguration.ts +++ b/src/util/config/types/RegionConfiguration.ts @@ -16,7 +16,7 @@ along with this program. If not, see . */ -import { Region } from "."; +import { Region } from "@spacebar/schemas"; export class RegionConfiguration { default: string = "spacebar"; diff --git a/src/util/config/types/subconfigurations/index.ts b/src/util/config/types/subconfigurations/index.ts index 400fb45e6..2f4eb1ce9 100644 --- a/src/util/config/types/subconfigurations/index.ts +++ b/src/util/config/types/subconfigurations/index.ts @@ -21,6 +21,5 @@ export * from "./defaults"; export * from "./guild"; export * from "./kafka"; export * from "./limits"; -export * from "./region"; export * from "./register"; export * from "./security"; diff --git a/src/util/config/types/subconfigurations/region/index.ts b/src/util/config/types/subconfigurations/region/index.ts deleted file mode 100644 index cc5447b03..000000000 --- a/src/util/config/types/subconfigurations/region/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - -export * from "./Region";