mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 12:04:02 +00:00
feat(bot): add safe group unsetup flow
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user