properly mark unused params

This commit is contained in:
Rory&
2026-03-14 03:59:28 +01:00
parent 27cb026967
commit a451f92e67
27 changed files with 78 additions and 39 deletions

View File

@@ -120,7 +120,7 @@ export async function Authentication(req: Request, res: Response, next: NextFunc
if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401));
try {
const { decoded, user, session, tokenVersion } = (req.tokenData = await checkToken(req.headers.authorization, {
const { decoded, user, session } = (req.tokenData = await checkToken(req.headers.authorization, {
ipAddress: req.ip,
fingerprint: req.fingerprint,
}));

View File

@@ -50,12 +50,14 @@ router.get(
limit = undefined;
}
return await ThreadMember.find({
where: { channel: { id: channel_id }, ...(after ? { user_id: MoreThan(after) } : {}) },
take: limit ? parseInt(limit) : 50,
order: { member_idx: "ASC" },
relations: { ...(with_member ? { member: true } : {}) },
});
return res.send(
await ThreadMember.find({
where: { channel: { id: channel_id }, ...(after ? { user_id: MoreThan(after) } : {}) },
take: limit ? parseInt(limit) : 50,
order: { member_idx: "ASC" },
relations: { ...(with_member ? { member: true } : {}) },
}),
);
},
);
router.post(

View File

@@ -217,6 +217,7 @@ router.get(
},
}),
async (req: Request, res: Response) => {
// noinspection JSUnusedLocalSymbols - ???
const { name, slop, tag, tag_setting, archived, sort_by, sort_order, limit, offset, max_id, min_id } = req.query as Record<string, string | undefined>;
const tags = tag ? tag.split(",") : [];
const { channel_id } = req.params as Record<string, string>;

View File

@@ -59,6 +59,7 @@ router.post(
},
);
// noinspection JSUnusedLocalSymbols - TODO: implement
router.post(
"/verify-code",
route({

View File

@@ -66,6 +66,7 @@ for (const type of Object.values(ReportMenuTypeNames)) {
},
);
if (process.env.LOG_ROUTES !== "false") console.log(`[Server] Route /reporting/menu/${type} registered (reports).`);
// noinspection JSUnusedLocalSymbols - TODO: implement
router.post(
`/${type}`,
route({

View File

@@ -149,6 +149,7 @@ router.patch(
},
}),
async (req: Request, res: Response) => {
// noinspection JSUnusedLocalSymbols - TODO: shouldnt token be checked?
const { webhook_id, token } = req.params as { [key: string]: string };
const body = req.body as WebhookUpdateSchema;

View File

@@ -228,6 +228,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
}
} else {
permission ||= await getPermission(opts.author_id, channel.guild_id, channel);
if (permission === null) throw new HTTPError("permission was null after getPermission", 500);
permission.hasThrow("SEND_MESSAGES");
if (permission.cache.member) {
message.member = permission.cache.member;
@@ -238,7 +239,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
permission.hasThrow("READ_MESSAGE_HISTORY");
// code below has to be redone when we add custom message routing
if (message.guild_id !== null) {
const guild = await Guild.findOneOrFail({
await Guild.findOneOrFail({
where: { id: channel.guild_id },
});
if (!opts.message_reference.guild_id) opts.message_reference.guild_id = channel.guild_id;