mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-26 03:15:06 +00:00
@@ -1,10 +1,15 @@
|
||||
import { Config } from "@fosscord/util";
|
||||
import {Config, Guild, Member} from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import {getVoiceRegions} from "../../../util/Voice";
|
||||
import {getIpAdress} from "../../../util/ipAddress";
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
return res.json(Config.get().regions.available);
|
||||
const { guild_id } = req.params;
|
||||
const guild = await Guild.findOneOrFail({ id: guild_id });
|
||||
//TODO we should use an enum for guild's features and not hardcoded strings
|
||||
return res.json(await getVoiceRegions(getIpAdress(req), guild.features.includes("VIP_REGIONS")));
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import {getIpAdress} from "../../util/ipAddress";
|
||||
import {getVoiceRegions} from "../../util/Voice";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
res.json(await getVoiceRegions(getIpAdress(req), true))//vip true?
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user