chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -61,12 +61,16 @@ export async function preflightDiscordMessage(
const logger = getChildLogger({ module: "discord-auto-reply" });
const message = params.data.message;
const author = params.data.author;
if (!author) return null;
if (!author) {
return null;
}
const allowBots = params.discordConfig?.allowBots ?? false;
if (author.bot) {
// Always ignore own messages to prevent self-reply loops
if (params.botUserId && author.id === params.botUserId) return null;
if (params.botUserId && author.id === params.botUserId) {
return null;
}
if (!allowBots) {
logVerbose("discord: drop bot message (allowBots=false)");
return null;
@@ -300,7 +304,9 @@ export async function preflightDiscordMessage(
channelName: displayChannelName,
channelSlug: displayChannelSlug,
});
if (isGroupDm && !groupDmAllowed) return null;
if (isGroupDm && !groupDmAllowed) {
return null;
}
const channelAllowlistConfigured =
Boolean(guildInfo?.channels) && Object.keys(guildInfo?.channels ?? {}).length > 0;