Skip to content

Commit c0547db

Browse files
committed
返信も通知する
1 parent 3fa2c26 commit c0547db

File tree

1 file changed

+21
-17
lines changed
  • packages/uplim-info-gmail/src

1 file changed

+21
-17
lines changed

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

+21-17
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,30 @@ function main() {
1616

1717
if (isLabeled) continue;
1818

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

38-
thread.addLabel(label);
40+
if (hasUnreadMessage) {
41+
thread.addLabel(label);
42+
}
3943
}
4044
}
4145

0 commit comments

Comments
 (0)