mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 13:54:02 +00:00
feat(bot): add safe group unsetup flow
This commit is contained in:
@@ -106,6 +106,7 @@ function createHouseholdRepository(): HouseholdConfigurationRepository {
|
||||
getHouseholdTopicBinding: async () => null,
|
||||
findHouseholdTopicByTelegramContext: async () => null,
|
||||
listHouseholdTopicBindings: async () => [],
|
||||
clearHouseholdTopicBindings: async () => {},
|
||||
listReminderTargets: async () => [],
|
||||
upsertHouseholdJoinToken: async () => {
|
||||
throw new Error('not used')
|
||||
@@ -309,6 +310,17 @@ function createPromptRepository(): TelegramPendingActionRepository {
|
||||
return pending
|
||||
},
|
||||
async clearPendingAction() {
|
||||
pending = null
|
||||
},
|
||||
async clearPendingActionsForChat(telegramChatId, action) {
|
||||
if (!pending || pending.telegramChatId !== telegramChatId) {
|
||||
return
|
||||
}
|
||||
|
||||
if (action && pending.action !== action) {
|
||||
return
|
||||
}
|
||||
|
||||
pending = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user