Skip to content

Commit 86e563d

Browse files
committed
fix
1 parent 1df088c commit 86e563d

File tree

1 file changed

+16
-22
lines changed
  • packages/uplim-info-gmail/src

1 file changed

+16
-22
lines changed

packages/uplim-info-gmail/src/main.ts

+16-22
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,25 @@ function main() {
1212

1313
if (isLabeled) continue;
1414

15-
let hasUnreadMessage = false;
1615
for (const message of thread.getMessages()) {
17-
if (message.isUnread()) {
18-
hasUnreadMessage = true;
19-
const text = createMessage(message);
20-
21-
const cutText =
22-
text.length > 2000 ? `${text.substring(0, 1995)}...` : text;
23-
24-
// biome-ignore lint/style/useTemplate: エスケープめっちゃ必要でむしろ読みにくくなるので
25-
const codeBlock = "```\n" + cutText + "\n```";
26-
27-
postMessage({
28-
username: "info@uplim.co.jp",
29-
parse: "full",
30-
avatar_url:
31-
"https://cdn.discordapp.com/attachments/792765244040675389/921661726863282176/pngegg.png",
32-
content: codeBlock,
33-
});
34-
}
35-
}
16+
const text = createMessage(message);
17+
18+
const cutText =
19+
text.length > 2000 ? `${text.substring(0, 1995)}...` : text;
3620

37-
if (hasUnreadMessage) {
38-
thread.addLabel(label);
21+
// biome-ignore lint/style/useTemplate: エスケープめっちゃ必要でむしろ読みにくくなるので
22+
const codeBlock = "```\n" + cutText + "\n```";
23+
24+
postMessage({
25+
username: "info@uplim.co.jp",
26+
parse: "full",
27+
avatar_url:
28+
"https://cdn.discordapp.com/attachments/792765244040675389/921661726863282176/pngegg.png",
29+
content: codeBlock,
30+
});
3931
}
32+
33+
thread.addLabel(label);
4034
}
4135
}
4236

0 commit comments

Comments
 (0)