mirror of
https://github.com/zhigang1992/github-telegram-notification.git
synced 2026-01-12 16:32:28 +08:00
fix: updating notification will trigger again
This commit is contained in:
@@ -51,7 +51,7 @@ async function checkUser(chatId: string, token: string) {
|
||||
}).then((r) => r.json());
|
||||
for (const notification of notifications) {
|
||||
const sentRef = admin.database().ref(`/sent/${chatId}/${notification.id}`);
|
||||
if ((await sentRef.get()).exists()) {
|
||||
if ((await sentRef.get()).val() !== notification.updated_at) {
|
||||
continue;
|
||||
}
|
||||
await bot.telegram.sendMessage(
|
||||
@@ -60,7 +60,7 @@ async function checkUser(chatId: string, token: string) {
|
||||
notification.subject.title
|
||||
}\n\n${processUrl(notification.subject.url)}`
|
||||
);
|
||||
await sentRef.set(true);
|
||||
await sentRef.set(notification.updated_at);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user