Route
You can create new routes in app/routes
Endpoints
Endpointsexport async function GET(client: Client, req: Request, res: Response) {
return res.json({
message: `Got a GET request`,
});
}Interacting with discord
Interacting with discordexport async function GET(client: Client, req: Request, res: Response) {
const guild = await client.guilds.fetch(String("1103319264921915392"));
const channel = await guild.channels.fetch(String("1260799306315731085"));
if (channel && channel.isTextBased()) {
await channel.send("Got a GET request");
console.log(`Message sent to channel ${channel.name}`);
}
return res.json({
message: `Message sent to channel: ${channel ? channel.name : "unknown"}`,
});
}Last updated