mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 19:14:03 +00:00
feat(bot): add guided private prompts
This commit is contained in:
@@ -35,3 +35,9 @@ export type {
|
||||
SettlementSnapshotLineRecord,
|
||||
SettlementSnapshotRecord
|
||||
} from './finance'
|
||||
export {
|
||||
TELEGRAM_PENDING_ACTION_TYPES,
|
||||
type TelegramPendingActionRecord,
|
||||
type TelegramPendingActionRepository,
|
||||
type TelegramPendingActionType
|
||||
} from './telegram-pending-actions'
|
||||
|
||||
20
packages/ports/src/telegram-pending-actions.ts
Normal file
20
packages/ports/src/telegram-pending-actions.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export const TELEGRAM_PENDING_ACTION_TYPES = ['anonymous_feedback'] as const
|
||||
|
||||
export type TelegramPendingActionType = (typeof TELEGRAM_PENDING_ACTION_TYPES)[number]
|
||||
|
||||
export interface TelegramPendingActionRecord {
|
||||
telegramUserId: string
|
||||
telegramChatId: string
|
||||
action: TelegramPendingActionType
|
||||
payload: Record<string, unknown>
|
||||
expiresAt: Date | null
|
||||
}
|
||||
|
||||
export interface TelegramPendingActionRepository {
|
||||
upsertPendingAction(input: TelegramPendingActionRecord): Promise<TelegramPendingActionRecord>
|
||||
getPendingAction(
|
||||
telegramChatId: string,
|
||||
telegramUserId: string
|
||||
): Promise<TelegramPendingActionRecord | null>
|
||||
clearPendingAction(telegramChatId: string, telegramUserId: string): Promise<void>
|
||||
}
|
||||
Reference in New Issue
Block a user