CHATBOT
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
- Open Telegram and search for @BotFather
- Start a conversation and send
/newbot - Choose a name for your bot (e.g., "Fevyfashionhub Assistant")
- Choose a username (e.g., "fevyfashionhub_bot")
- Copy the bot token that BotFather provides
In your Val Town environment, set these variables:
-
TELEGRAM_BOT_TOKEN: Your bot token from BotFather
1234567890:ABCdefGHIjklMNOpqrSTUvwxYZ1234567890 -
TELEGRAM_ADMIN_IDS (Optional): Comma-separated admin user IDs
123456789,987654321
To get your Telegram user ID:
- Message @userinfobot on Telegram
- It will reply with your user ID
-
Visit your bot's setup webhook URL:
https://your-val-url.web.val.run/setup-webhook -
You should see a success message confirming the webhook is set
- Find your bot on Telegram using the username you created
- Send
/startto begin interacting with the bot - Test the various features:
- View courses
- Check fees
- Ask questions
- Join chat room
- Course Information: Browse available fashion courses by category
- Fee Structure: View transparent pricing for all programs
- Ask Questions: Submit inquiries about courses, enrollment, fees, etc.
- Chat Room: Community space to discuss with other students
- Contact Information: Get school contact details
- Statistics: View student count and inquiry stats
- Manage Inquiries: See and respond to pending student questions
- Student Management: View list of active students
- Chat Moderation: Monitor community discussions
/start- Welcome message and main menu/courses- View available courses/fees- View fee structure/contact- Contact information/help- Help and support/admin- Admin panel (admin only)
Courses are stored in the database. To modify them:
- Edit the
insertDefaultCourses()function in/backend/database/migrations.ts - Change the table name (e.g., add
_2to create a fresh table) - Redeploy and visit
/init-dbto update
Edit the contact details in /backend/bot/messages.ts in the contactMessage variable.
The bot is modular and easy to extend:
- Add new keyboards in
/backend/bot/keyboards.ts - Add new message templates in
/backend/bot/messages.ts - Add new handlers in
/backend/bot/handlers.ts
GET /
GET /webhook-info
GET /bot-info
GET /test
If you need help with setup or customization:
- Check the logs in Val Town for any error messages
- Test individual endpoints to isolate issues
- Verify environment variables are set correctly
- Ensure webhook is properly configured
- Customize Content: Update course information, fees, and contact details
- Brand Styling: Customize messages and emojis to match your brand
- Add Features: Consider adding payment integration, scheduling, etc.
- Promote: Share your bot with students and on social media
Your Fevyfashionhub Telegram bot is ready to help students learn about your fashion school! πβ¨