mirror of
https://github.com/whekin/household-bot.git
synced 2026-04-01 00:24:03 +00:00
fix(bot): hand off reminder dashboard opens through dm
This commit is contained in:
13
apps/bot/src/telegram-deep-links.ts
Normal file
13
apps/bot/src/telegram-deep-links.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export function buildBotStartDeepLink(
|
||||
botUsername: string | undefined,
|
||||
payload: string
|
||||
): string | null {
|
||||
const normalizedBotUsername = botUsername?.trim()
|
||||
const normalizedPayload = payload.trim()
|
||||
|
||||
if (!normalizedBotUsername || !normalizedPayload) {
|
||||
return null
|
||||
}
|
||||
|
||||
return `https://t.me/${normalizedBotUsername}?start=${encodeURIComponent(normalizedPayload)}`
|
||||
}
|
||||
Reference in New Issue
Block a user