mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 13:34:58 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -13,7 +13,9 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
|
||||
const handleReactionEvent = async (event: SlackReactionEvent, action: string) => {
|
||||
try {
|
||||
const item = event.item;
|
||||
if (!item || item.type !== "message") return;
|
||||
if (!item || item.type !== "message") {
|
||||
return;
|
||||
}
|
||||
|
||||
const channelInfo = item.channel ? await ctx.resolveChannelName(item.channel) : {};
|
||||
const channelType = channelInfo?.type;
|
||||
@@ -54,7 +56,9 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
|
||||
ctx.app.event(
|
||||
"reaction_added",
|
||||
async ({ event, body }: SlackEventMiddlewareArgs<"reaction_added">) => {
|
||||
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
||||
if (ctx.shouldDropMismatchedSlackEvent(body)) {
|
||||
return;
|
||||
}
|
||||
await handleReactionEvent(event as SlackReactionEvent, "added");
|
||||
},
|
||||
);
|
||||
@@ -62,7 +66,9 @@ export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }
|
||||
ctx.app.event(
|
||||
"reaction_removed",
|
||||
async ({ event, body }: SlackEventMiddlewareArgs<"reaction_removed">) => {
|
||||
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
||||
if (ctx.shouldDropMismatchedSlackEvent(body)) {
|
||||
return;
|
||||
}
|
||||
await handleReactionEvent(event as SlackReactionEvent, "removed");
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user