mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 19:04:58 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -50,9 +50,13 @@ export async function removeOwnReactionsDiscord(
|
||||
const identifiers = new Set<string>();
|
||||
for (const reaction of message.reactions ?? []) {
|
||||
const identifier = buildReactionIdentifier(reaction.emoji);
|
||||
if (identifier) identifiers.add(identifier);
|
||||
if (identifier) {
|
||||
identifiers.add(identifier);
|
||||
}
|
||||
}
|
||||
if (identifiers.size === 0) {
|
||||
return { ok: true, removed: [] };
|
||||
}
|
||||
if (identifiers.size === 0) return { ok: true, removed: [] };
|
||||
const removed: string[] = [];
|
||||
await Promise.allSettled(
|
||||
Array.from(identifiers, (identifier) => {
|
||||
@@ -78,7 +82,9 @@ export async function fetchReactionsDiscord(
|
||||
}>;
|
||||
};
|
||||
const reactions = message.reactions ?? [];
|
||||
if (reactions.length === 0) return [];
|
||||
if (reactions.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const limit =
|
||||
typeof opts.limit === "number" && Number.isFinite(opts.limit)
|
||||
? Math.min(Math.max(Math.floor(opts.limit), 1), 100)
|
||||
@@ -87,7 +93,9 @@ export async function fetchReactionsDiscord(
|
||||
const summaries: DiscordReactionSummary[] = [];
|
||||
for (const reaction of reactions) {
|
||||
const identifier = buildReactionIdentifier(reaction.emoji);
|
||||
if (!identifier) continue;
|
||||
if (!identifier) {
|
||||
continue;
|
||||
}
|
||||
const encoded = encodeURIComponent(identifier);
|
||||
const users = (await rest.get(Routes.channelMessageReaction(channelId, messageId, encoded), {
|
||||
limit,
|
||||
|
||||
Reference in New Issue
Block a user