/[sudobot]/trunk/src/api/routes/channels.ts
ViewVC logotype

Contents of /trunk/src/api/routes/channels.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53 - (show annotations)
Mon Jul 29 17:28:23 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 504 byte(s)
Push api directory
1 import { Request, Response } from "express";
2 import DiscordClient from "../../client/Client";
3 import auth from "../Auth";
4 import guildAuth from "../GuildAuth";
5 import { Route } from "../Router";
6
7 export default <Route> {
8 path: '/channels/:guild',
9 middleware: [guildAuth],
10 async get(req: Request, res: Response) {
11 const guild = await DiscordClient.client.guilds.fetch(req.params.guild);
12 const channels = await guild.channels.cache.toJSON();
13 res.send(channels);
14 }
15 };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26