mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 15:44:02 +00:00
14 lines
380 B
TypeScript
14 lines
380 B
TypeScript
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)}`
|
|
}
|