Skip to content

Commit

Permalink
fix: add some debug logging
Browse files Browse the repository at this point in the history
Signed-off-by: Eiko Wagenknecht <[email protected]>
  • Loading branch information
eikowagenknecht committed Feb 10, 2025
1 parent 5410a0a commit 5509659
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/services/telegrambot/utils/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export async function sendNewOffersToChat(
});

for (const offer of offers) {
logger.verbose(
`Sending offer ${offer.id.toFixed()} to chat ${chat.chat_id.toFixed()}`,
);

// For channels, groups and supergroups, show no buttons as they would
// affect all users. Always show details.
const isMultiUserChat =
Expand Down Expand Up @@ -140,6 +144,10 @@ export async function sendNewAnnouncementsToChat(

// Send each announcement
for (const announcement of announcements) {
logger.verbose(
`Sending announcement ${announcement.id.toFixed()} to chat ${chat.chat_id.toFixed()}`,
);

await telegramBotService
.getBot()
.api.sendMessage(chat.chat_id, announcement.text_markdown, {
Expand All @@ -148,10 +156,6 @@ export async function sendNewAnnouncementsToChat(
});

await updateTelegramChatLastAnnouncementId(chat.id, announcement.id);

logger.verbose(
`Sent announcement ${announcement.id.toFixed()} to chat ${chat.chat_id.toFixed()}`,
);
}
} catch (error) {
// Check for blocked chat errors
Expand Down

0 comments on commit 5509659

Please sign in to comment.