feat(bot): add safe group unsetup flow

This commit is contained in:
2026-03-11 06:08:34 +04:00
parent 1b8c6e87f6
commit b6b6f9e1b8
25 changed files with 495 additions and 0 deletions

View File

@@ -503,6 +503,12 @@ export function createDbHouseholdConfigurationRepository(databaseUrl: string): {
return rows.map(toHouseholdTopicBindingRecord)
},
async clearHouseholdTopicBindings(householdId) {
await db
.delete(schema.householdTopicBindings)
.where(eq(schema.householdTopicBindings.householdId, householdId))
},
async listReminderTargets() {
const rows = await db
.select({

View File

@@ -151,6 +151,19 @@ export function createDbTelegramPendingActionRepository(databaseUrl: string): {
eq(schema.telegramPendingActions.telegramUserId, telegramUserId)
)
)
},
async clearPendingActionsForChat(telegramChatId, action) {
await db
.delete(schema.telegramPendingActions)
.where(
action
? and(
eq(schema.telegramPendingActions.telegramChatId, telegramChatId),
eq(schema.telegramPendingActions.action, action)
)
: eq(schema.telegramPendingActions.telegramChatId, telegramChatId)
)
}
}