24 lines
604 B
TypeScript
24 lines
604 B
TypeScript
import { Request, Response } from "express";
|
|
import { client as bot } from "@bot/bot";
|
|
import { getLogger } from "@server/../log";
|
|
|
|
const logger = getLogger(__filename);
|
|
|
|
export const get = async (request: Request, response: Response) => {
|
|
logger.debug("GET - feed page");
|
|
|
|
const guildId = request.params.guildId;
|
|
const guild = bot.guilds.cache.get(guildId);
|
|
|
|
if (!guild) {
|
|
response.status(404).send("404: guild not found");
|
|
return;
|
|
}
|
|
|
|
response.render("guild/feeds", {
|
|
title: `${guild.name} - Relay`,
|
|
guild: guild
|
|
});
|
|
};
|
|
|
|
export default { get } |