Skip to content

Commit

Permalink
返信も通知する
Browse files Browse the repository at this point in the history
  • Loading branch information
k1tikurisu committed Dec 18, 2024
1 parent 3fa2c26 commit c0547db
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions packages/uplim-info-gmail/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,30 @@ function main() {

if (isLabeled) continue;

const hasUnreadMessage = false;
for (const message of thread.getMessages()) {
if (!message.isUnread()) return;
const text = createMessage(message);

const cutText =
text.length > 2000 ? `${text.substring(0, 1995)}...` : text;

// biome-ignore lint/style/useTemplate: エスケープめっちゃ必要でむしろ読みにくくなるので
const codeBlock = "```\n" + cutText + "\n```";

postMessage({
username: "[email protected]",
parse: "full",
avatar_url:
"https://cdn.discordapp.com/attachments/792765244040675389/921661726863282176/pngegg.png",
content: codeBlock,
});
if (message.isUnread()) {
const text = createMessage(message);

const cutText =
text.length > 2000 ? `${text.substring(0, 1995)}...` : text;

// biome-ignore lint/style/useTemplate: エスケープめっちゃ必要でむしろ読みにくくなるので
const codeBlock = "```\n" + cutText + "\n```";

postMessage({
username: "[email protected]",
parse: "full",
avatar_url:
"https://cdn.discordapp.com/attachments/792765244040675389/921661726863282176/pngegg.png",
content: codeBlock,
});
}
}

thread.addLabel(label);
if (hasUnreadMessage) {
thread.addLabel(label);
}
}
}

Expand Down

0 comments on commit c0547db

Please sign in to comment.