Actually save webhook apps - fixes #1474

This commit is contained in:
Rory&
2026-02-03 05:21:33 +01:00
parent a7dd9647fb
commit 762ea242c0

View File

@@ -17,7 +17,7 @@
*/
import { route } from "@spacebar/api";
import { Channel, Config, DiscordApiErrors, User, Webhook, handleFile, trimSpecial, ValidateName } from "@spacebar/util";
import { Channel, Config, DiscordApiErrors, User, Webhook, handleFile, trimSpecial, ValidateName, Application } from "@spacebar/util";
import crypto from "crypto";
import { Request, Response, Router } from "express";
import { HTTPError } from "lambert-server";
@@ -98,6 +98,7 @@ router.post(
guild_id: channel.guild_id,
channel_id: channel.id,
user_id: req.user_id,
application: (await Application.findOneBy({ id: req.user_id })) ?? undefined,
token: crypto.randomBytes(24).toString("base64url"),
}).save();