Hearing Aid Appointments W.A Bot
from models import Schedule, DoctorLocation, AppointmentInProgress, Doctor, db, Location, WhatsAppClient, Appointment, Message
from actions import update_client_name, suggest_other_times
from app_init import app
from datetime import datetime, timedelta
from abilities import llm
import json
import requests
import phonenumbers
from phonenumbers.timezone import time_zones_for_number
import os
from flask import render_template, request, redirect, url_for, session, jsonify
from twilio.rest import Client
from gunicorn.app.base import BaseApplication
from utils import get_available_slots
import logging
from process_action import *
from page_routes import *
from page_operations import *
import pytz
from datetime import datetime
from actions import (
find_nearest_location, check_doctor_availability,
find_closest_available_appointment, book_appointment,
get_weekly_availability, cancel_appointment,
Created: | Last Updated:
Here's a step-by-step guide for using the Hearing Aid Appointments W.A Bot template:
Introduction
The Hearing Aid Appointments W.A Bot is a WhatsApp bot designed to help clients schedule appointments for hearing aid consultations. It automates the booking process, sends reminders, and manages follow-ups throughout the day.
Getting Started
To begin using this template:
- Click the "Start with this Template" button in the Lazy Builder interface.
Initial Setup
Before running the bot, you need to set up some environment secrets:
- Go to the "Environment Secrets" tab in the Lazy Builder.
- Add the following secrets:
TWILIO_ACCOUNT_SID
: Your Twilio Account SIDTWILIO_AUTH_TOKEN
: Your Twilio Auth Token
To obtain these credentials:
- Sign up for a Twilio account at https://www.twilio.com if you haven't already.
- Navigate to your Twilio Console.
- Find your Account SID and Auth Token on the dashboard.
- Copy these values and paste them into the corresponding environment secrets in Lazy.
Test the Application
To deploy and run the bot:
- Click the "Test" button in the Lazy Builder interface.
- Wait for the deployment process to complete.
Entering Input
After deployment, you'll be prompted to enter some information through the Lazy CLI:
- Enter your WhatsApp business phone number (the number you want the bot to use).
- Provide any additional configuration details as prompted.
Using the App
Once set up, the bot will be ready to handle WhatsApp messages. It can:
- Guide users through the appointment booking process
- Suggest available time slots
- Confirm bookings
- Handle rescheduling and cancellations
- Send follow-up messages to users who haven't completed their bookings
Integrating the App
To fully integrate the bot with your WhatsApp Business account:
- Log into your Twilio Console.
- Navigate to "Messaging" > "Settings" > "WhatsApp Sandbox".
- In the "Sandbox Configuration" section, find the "When a message comes in" field.
- Paste the server link provided by Lazy after deployment into this field.
- Save your changes.
Now, your WhatsApp bot is connected and ready to handle incoming messages.
Setting Up WhatsApp Business API
To use this bot with a real WhatsApp Business number:
- Apply for WhatsApp Business API access through Twilio.
- Once approved, follow Twilio's instructions to set up your WhatsApp Business number.
- Update your Twilio configuration to use the new number instead of the sandbox.
Remember to update the bot's phone number in the Lazy environment secrets if it changes during this process.
By following these steps, you'll have a fully functional WhatsApp bot for managing hearing aid appointments, integrated with your business processes.
Here are 5 key business benefits for this Hearing Aid Appointments WhatsApp Bot template:
Template Benefits
-
Automated Appointment Scheduling - The bot handles the entire appointment booking process 24/7, reducing staff workload and allowing clients to book at their convenience.
-
Increased Conversion Rates - Automated follow-ups and reminders help convert more leads into booked appointments by re-engaging potential clients.
-
Improved Client Experience - Provides a seamless, conversational interface for scheduling that is accessible and familiar to clients through WhatsApp.
-
Efficient Resource Management - Automatically manages doctor availability and schedules across multiple locations to optimize appointment slots.
-
Data-Driven Insights - Captures valuable data on client interactions, appointment trends, and conversion rates to inform business decisions and marketing strategies.
Technologies


