-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fa2c26
commit c0547db
Showing
1 changed file
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} | ||
} | ||
} | ||
|
||
|