Telegram Bot + Mini App for city walking quests. - React 19 + TypeScript + Vite 6 frontend - Express 5 + PostgreSQL backend - grammY Telegram bot with DeepSeek AI - GitLab CI/CD: lint, build, deploy to production Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
export function getReactionPrompt(params: {
|
|
eventType: string
|
|
pointTitle?: string
|
|
city: string
|
|
lang: string
|
|
companions: string
|
|
pace: string
|
|
}): string {
|
|
const langInstruction = params.lang === 'ru'
|
|
? 'Write the reaction in Russian.'
|
|
: 'Write the reaction in English.'
|
|
|
|
const eventDescriptions: Record<string, string> = {
|
|
arrived: `The traveler has arrived at "${params.pointTitle}" in ${params.city}.`,
|
|
skipped: `The traveler decided to skip "${params.pointTitle}".`,
|
|
finished_today: `The traveler decided to finish for today in ${params.city}.`,
|
|
point_completed: `The traveler has finished exploring "${params.pointTitle}" and is ready for the next step.`,
|
|
day_completed: `The traveler has completed all points for today in ${params.city}.`,
|
|
quest_completed: `The traveler has completed the entire quest in ${params.city}!`,
|
|
}
|
|
|
|
return `${eventDescriptions[params.eventType] || 'The traveler performed an action.'}
|
|
|
|
Companions: ${params.companions}, Pace: ${params.pace}
|
|
|
|
${langInstruction}
|
|
|
|
Generate a short, atmospheric reaction message (2-3 sentences max).
|
|
- Keep the adventurous guide tone
|
|
- Be encouraging and warm
|
|
- If they skipped, be understanding
|
|
- If they completed, celebrate
|
|
- Make it personal and contextual
|
|
|
|
Write only the message text, no formatting, no JSON.`
|
|
}
|