Overview
This guide explains how to run and operate the Pizzario Telegram bot in a Docker container with minimal startup configuration, and how to configure all optional features directly within Telegram. It covers keys, hosting providers, payments, maps, domains, themes, language, support, notifications, and the admin dashboard.
TELEGRAM_BOT_TOKEN and
GEMINI_API_KEY. Everything else is configured inside the bot and stored in SQLite under
/app/data.
Table of Contents
- ๐ Getting Started
- Requirements
- Create Telegram Bot Token
- Create Gemini API Key
- Build & Run Docker (Windows & Linux)
- ๐ง Admin Documentation
- First-Run Wizard & Admin Lock
- Admin Dashboard Usage
- Cloudflare Pages & R2 Tokens
- Maps: Google vs OpenStreetMap
- Setup PayPal
- Setup Gumroad
- Setup Telegram Stars
- Webhook Base URL (Detailed Guide)
- Notifications Setup
- Bulk Messages
- Premium Plan Configuration
- Namesilo & Manual Domain Linking
- Add More Themes
- Add More Languages
- Rename the Bot
- Ask the AI Assistant
- Health Check & Ports
- ๐ค User Documentation
- How Users Generate a Site
- Edit Main Offer (Hero)
- Change Language
- Customize the Site
- Search Domain & Send to Admin
- Contact Support
- FAQ
๐ Getting Started
Requirements
- Telegram account to manage the bot
- Docker installed on Windows or Linux
- Two environment variables ready:
TELEGRAM_BOT_TOKENandGEMINI_API_KEY - Optional: Cloudflare account (Pages, R2), PayPal, Gumroad
Create Telegram Bot Token
- Open Telegram and search for BotFather.
- Send
/newbotand follow prompts (choose a name and a unique username ending withbot). - BotFather returns a token like
123456:ABC-DEF.... Keep it secret.
Use this token as TELEGRAM_BOT_TOKEN when starting the container.
Create Gemini API Key
- Go to Google AI Studio and sign in.
- Create an API key under the Keys section.
- Copy the key and store it securely.
Use this as GEMINI_API_KEY. The bot's AI assistant is immediately available after startup.
Build & Run Docker (Windows & Linux)
Windows (PowerShell)
docker build -t pizzario-bot .
docker run -e TELEGRAM_BOT_TOKEN=<token> -e GEMINI_API_KEY=<key> -p 3000:3000 -v pizzario-data:/app/data pizzario-bot
Linux (bash)
docker build -t pizzario-bot .
docker run -e TELEGRAM_BOT_TOKEN=<token> -e GEMINI_API_KEY=<key> -p 3000:3000 -v pizzario-data:/app/data pizzario-bot
Replace <token> with your actual bot token and <key> with your Gemini API key.
/admin to proceed.๐ง Admin Documentation
Everything you need to know to configure and manage the Pizzario Bot as an administrator.
First-Run Wizard & Admin Lock
After startup, send /admin from your Telegram account. The first caller is permanently stored as
the primary admin.
- Use
/adminto access the admin dashboard. - Use the "First Run Setup Wizard" buttons to configure AI, Hosting, Payments, Premium plan, and Maps.
- All changes are stored in SQLite; no container restart is required.
Admin Dashboard Usage
Open /admin. Controls include:
- List Users - View all users, their sites, and manage their accounts
- Support Tickets - View and respond to user support requests
- Setup Hosting - Configure Cloudflare Pages or R2 storage
- Setup Payment - Configure PayPal, Gumroad, or Telegram Stars
- Namesilo API Setup - Enable domain availability lookups
- AI Assistant - Get help from the built-in AI
- Documentation - Access documentation files
- Map Provider Setup - Choose Google Maps or OpenStreetMap
- Edit Premium Plan - Configure pricing and premium features
- Notifications - Configure admin notification preferences
Cloudflare Pages & R2 Tokens
To enable site deployment and image storage, you need to connect your Cloudflare account. This requires your Account ID and a custom API Token.
1. Get Your Account ID
- Log in to the Cloudflare Dashboard.
- Go to Workers & Pages on the left sidebar.
- Look for "Account ID" on the right side of the Overview page.
- Copy this ID (e.g.,
a1b2c3d4e5f6...).
2. Create API Token
You need a token with permissions for both Cloudflare Pages (hosting) and R2 (storage).
- Go to My Profile โ API Tokens.
- Click Create Token.
- Scroll down and click Get started next to "Create Custom Token".
- Name the token (e.g., "Pizzario Bot").
- Permissions: Add the following 3 permissions:
- Account | Cloudflare Pages | Edit
- Account | Workers R2 Storage | Edit
- Account | Workers R2 Storage | Read
- Account Resources: Select "Include" โ "All accounts" (or your specific account).
- Click Continue to summary โ Create Token.
- Copy the token immediately (you won't see it again).
3. Connect Inside the Bot
- Open
/adminโ "Setup Hosting". - Choose "Cloudflare Pages" or "Cloudflare R2 Storage".
- Paste the combined string:
ACCOUNT_ID:API_TOKEN.
Maps: Google vs OpenStreetMap
Recommendation
Setup OSM
- Open
/adminโ "Map Provider Setup". - Select "OpenStreetMap (free)".
Setup Google Maps
- Create a Google Cloud project and enable:
- Maps Embed API
- Places API
- Geocoding API
- Create an API key; restrict it to your allowed environments.
- Open
/adminโ "Map Provider Setup" โ "Use Google Maps", then paste the API key when prompted.
Setup PayPal
- Create a PayPal REST app and obtain Client ID and Client Secret.
- Open
/adminโ "Payment Setup" โ "PayPal". - Enter Client ID, then Client Secret, then choose Mode (
sandboxorlive). - Paste the Webhook Base URL (see detailed guide below).
The bot exposes POST /paypal/webhook and GET /health on the configured port.
Setup Gumroad
- Open
/adminโ "Payment Setup" โ "Gumroad". - Provide Product URL, Seller ID, and Billing Period (days).
- Use "Connect Gumroad" to validate.
Setup Telegram Stars
- Open
/adminโ "Payment Setup" โ "Telegram Stars". - Set Stars Price and Billing Period.
- Enable or disable as needed.
Webhook Base URL (Detailed Guide for Beginners)
The Webhook Base URL is one of the most important settings for accepting payments. Here's everything you need to know, explained step-by-step for non-technical users.
What is a Webhook URL?
Think of a webhook like a doorbell. When someone pays for your service through PayPal, PayPal "rings the doorbell" of your bot to tell it "Hey, someone just paid!" The Webhook URL is the address where PayPal knows to ring that doorbell.
Why Do You Need It?
- Without it, PayPal has no way to tell your bot when a payment is successful
- This means users won't automatically get their premium features activated
- You would have to manually check PayPal and upgrade users yourself
What Does a Webhook URL Look Like?
Format: https://your-domain.com
Examples:
https://bot.mypizzashop.com- Using your own domainhttps://pizzario.myserver.io- Using a subdomainhttps://mysite.ngrok.io- Using ngrok for testing
Important: Do NOT include a trailing slash or any path. The bot will add
/paypal/webhook automatically.
Choose Your Setup Method
Pick the option that best matches your situation:
๐ Option 1: You Have Your Own Domain (Recommended for Production)
Best for: Running a real business with real payments
Step 1: Buy a Domain Name
A domain is like your address on the internet (example: mypizzabot.com).
Where to buy:
- Namecheap.com - Popular and affordable (~$10/year)
- Namesilo.com - Very cheap, no hidden fees (~$9/year)
- GoDaddy.com - Well-known, easy to use
What to buy: Any .com domain you like. Example: mypizzabot.com
or pizzarioserver.com
Step 2: Find Your Server's IP Address
Your server (the computer running your bot) has a unique number called an IP address. You need this to connect your domain to your server.
How to find it:
- If using a VPS (like DigitalOcean, Vultr, Linode): Look in your dashboard, it's usually displayed prominently
- If running at home: Go to whatismyip.com to see your public IP
Example IP: 164.92.123.45 (yours will be different)
Step 3: Connect Your Domain to Your Server (DNS Settings)
This tells the internet "when someone visits my domain, send them to my server."
Step-by-step for Namecheap (similar for others):
- Log into Namecheap and go to "Domain List"
- Click "Manage" next to your domain
- Click "Advanced DNS" tab
- Click "Add New Record" button
- Fill in:
- Type: Select "A Record"
- Host: Type
bot(this creates bot.yourdomain.com) - Value: Paste your server's IP address (like
164.92.123.45) - TTL: Leave as "Automatic"
- Click the green checkmark to save
Result: Now bot.yourdomain.com points to your server!
Wait time: DNS changes can take 5 minutes to 24 hours to work worldwide. Usually it's about 15-30 minutes.
Step 4: Set Up HTTPS (Security Certificate)
PayPal requires your connection to be secure (HTTPS with the padlock icon). The easiest free way is using Cloudflare:
Using Cloudflare (Recommended - Free & Easy):
- Go to cloudflare.com and create a free account
- Click "Add a Site" and enter your domain (like
yourdomain.com) - Select the FREE plan
- Cloudflare will show you new nameservers (like
anna.ns.cloudflare.com) - Go back to Namecheap โ Domain โ Nameservers โ Select "Custom DNS"
- Paste the two Cloudflare nameservers
- Wait 1-24 hours for it to activate
- In Cloudflare, go to SSL/TLS โ Set mode to "Flexible" or "Full"
Result: Your domain now has HTTPS automatically! The padlock icon will appear.
Step 5: Open the Port on Your Server
Your server has a "firewall" that blocks unwanted traffic. You need to allow traffic on port 3000 (where your bot listens).
For Windows Server:
- Open "Windows Defender Firewall with Advanced Security"
- Click "Inbound Rules" on the left
- Click "New Rule..." on the right
- Select "Port" โ Click Next
- Select "TCP" and enter
3000โ Click Next - Select "Allow the connection" โ Click Next
- Check all boxes (Domain, Private, Public) โ Click Next
- Name it "Pizzario Bot" โ Click Finish
For Linux (Ubuntu/Debian):
sudo ufw allow 3000
Step 6: Enter Your URL in the Bot
- Open Telegram and send
/adminto your bot - Click "๐ณ Setup Payment"
- Click "PayPal"
- When asked for Webhook URL, enter:
https://bot.yourdomain.com
Replace yourdomain.com with your actual domain!
๐งช Option 2: Using ngrok for Testing (Free, No Domain Needed)
Best for: Testing payments before going live. NOT for real business use.
What is ngrok? It's a free tool that creates a temporary public URL for your local computer. Think of it as a "temporary doorbell" for testing.
Step 1: Download and Install ngrok
- Go to ngrok.com
- Click "Sign up" and create a free account
- After signing in, click "Download" for your operating system
- Extract the downloaded file somewhere you can find it (like your Desktop)
Step 2: Connect ngrok to Your Account
- On the ngrok website, go to "Your Authtoken" in the dashboard
- Copy the long code that looks like:
2abc123def456... - Open Command Prompt (Windows) or Terminal (Mac/Linux)
- Navigate to where you saved ngrok:
cd Desktop - Run:
ngrok config add-authtoken YOUR_TOKEN_HERE
Replace YOUR_TOKEN_HERE with the code you copied.
Step 3: Start ngrok
- Make sure your Pizzario bot is running first
- In Command Prompt/Terminal, run:
ngrok http 3000 - You'll see something like this:
Session Status online Forwarding https://abc123xyz.ngrok.io -> http://localhost:3000
- Copy the
https://URL (the one ending in.ngrok.io)
Step 4: Enter the URL in Your Bot
- Open Telegram and send
/adminto your bot - Click "๐ณ Setup Payment" โ "PayPal"
- When asked for Webhook URL, paste your ngrok URL:
https://abc123xyz.ngrok.io
- The URL changes every time you restart ngrok
- Free ngrok has limited connections
- If you close the command window, ngrok stops
- This is ONLY for testing - use Option 1 for real payments
โ๏ธ Option 3: Using a Cloud Hosting Platform (Easiest for Beginners)
Best for: People who don't want to manage their own server
What are these? Cloud platforms run your bot for you. They give you a permanent URL automatically - no domain purchase or setup needed!
Popular platforms and their URLs:
| Platform | Your URL Format | Example |
|---|---|---|
| Railway | https://YOUR-PROJECT.up.railway.app |
https://pizzario-bot.up.railway.app |
| Render | https://YOUR-SERVICE.onrender.com |
https://pizzario-bot.onrender.com |
| Fly.io | https://YOUR-APP.fly.dev |
https://pizzario-bot.fly.dev |
| Heroku | https://YOUR-APP.herokuapp.com |
https://pizzario-bot.herokuapp.com |
How to use: After deploying your bot to any of these platforms, just find your app's URL in the dashboard and paste it into the bot's Payment Setup!
How to Test If Your Webhook URL is Working
Easy Test (Do This First!):
- Open any web browser (Chrome, Firefox, Edge, Safari)
- In the address bar, type your webhook URL followed by
/health
Example:https://bot.yourdomain.com/health - Press Enter
What you should see:
{"status":"ok","service":"pizzario-payment-gateway","timestamp":"2024-01-15T10:30:00.000Z"}
โ If you see this message: Congratulations! Your webhook URL is working correctly.
โ If you see an error or blank page: Something is wrong. Check the troubleshooting section below.
Troubleshooting: Common Problems and How to Fix Them
| What You See | What It Means | How to Fix It |
|---|---|---|
| "This site can't be reached" or "Connection refused" | The browser can't find or connect to your server |
|
| "Your connection is not private" or SSL error | HTTPS is not set up correctly |
|
| "DNS_PROBE_FINISHED_NXDOMAIN" | Your domain name doesn't exist or DNS isn't set up |
|
| Payments go through but users don't get upgraded | PayPal can't reach your webhook |
|
/ai command in your bot to ask for help! The AI assistant
knows about this documentation and can guide you through the setup.
Notifications Setup
The Notifications feature allows you to stay informed about important events happening in your bot. As an admin, you can receive real-time alerts directly in Telegram.
How to Access Notifications Settings
- Open
/adminin Telegram - Click on "๐ Notifications"
- Configure your notification preferences
Available Notification Types
| Notification | Description | When It Triggers |
|---|---|---|
| New Site Created | Alert when a user creates a new pizza website | After successful site deployment |
| New Support Ticket | Alert when a user submits a support request | When user uses /support command |
| Payment Received | Alert when a premium payment is confirmed | After PayPal/Stars payment completes |
| Domain Request | Alert when a user requests a custom domain | When user submits domain for approval |
| Customization Updates | Alert when a user uploads logo or images | After image upload completes |
How to Enable/Disable Notifications
- Navigate to
/adminโ "Notifications" - Toggle each notification type on or off
- Settings are saved automatically
Notification Format
Notifications are sent as Telegram messages with relevant details:
Example - New Support Ticket:
๐ New Support Ticket #42 ๐ค User: @john_pizza (12345678) ๐ Issue: Website Customization ๐ Description: I want to change my menu layout...
Best Practices
- Enable support ticket notifications - Respond quickly to user issues
- Enable payment notifications - Stay informed about revenue
- Consider disabling customization notifications if you have many active users to avoid notification overload
๐ข Bulk Messages
Send broadcast messages to all your bot users (everyone who has started the bot). This is great for announcements, promotions, or updates.
How to Send
- Open
/adminโ "๐ข Bulk Messages". - Click "โ๏ธ Create New Message".
- Step 1: Send the text content for your message. You can use emojis!
- Step 2: Optionally attach an image. Send a photo or type "no" to skip.
- Step 3: Choose when to send:
- ๐ Send Now: Starts sending immediately (within 1 minute).
- โฐ In 1 Hour: Schedules for later.
- ๐ In 24 Hours / 1 Week: Good for planned promotions.
Managing Messages
- View Scheduled: Click "๐ View Scheduled Messages" to see upcoming and recent messages.
- Status: You can see how many users received the message and if any failed.
- Cancel: You can cancel any message that is still "Pending" (hasn't started sending yet).
Namesilo & Manual Domain Linking
Option 1: Manual Domain Linking (Any Registrar)
If you purchase a domain for a user manually (e.g., from Namecheap, GoDaddy, or Namesilo), follow these steps to link it to their site:
- Get the User's Site URL: Ask the user for their current site link (e.g.,
https://pizzeria-1234.pizzariobot.com). - Configure DNS: Go to your domain registrar's DNS settings for the new domain.
- Create a CNAME record.
- Host:
@(orwww) - Value/Target: The user's current site URL (without
https://). - Example: Point
mypizza.comtopizzeria-1234.pizzariobot.com.
- Wait for Propagation: DNS changes can take 15-30 minutes.
- Inform the User: Tell the user their new domain is ready! They can now use
mypizza.comto access their site.
Option 2: Namesilo API (Automated)
If you have a Namesilo account, you can let users search for domains directly in the bot.
- Open
/adminโ "Namesilo API Setup". - Paste your Namesilo API key.
- Users can now use
/domainto search for available domains. - If they request a domain, you (the admin) will get a notification to approve/buy it manually.
Add More Themes
- Add new template HTML files to the templates directory.
- Users can then select the new template via
/templates. - Publish changes to apply the theme.
Add More Languages
- Enable Language feature as Free or Premium in the Premium Plan.
- Users can change their site language and republish.
Rename the Bot
- Open BotFather in Telegram.
- Use
/setnameand/setdescriptionto update display name and description.
Token remains unchanged. Users see the new name immediately.
Ask the AI Assistant
Use /ai <question> at any time for setup help, troubleshooting, or best practices. The
assistant is available immediately after startup.
Health Check & Ports
- Single HTTP port for webhooks and health:
PORTenv, default3000. - Health endpoint:
GET /healthreturns 200 and status JSON. - Graceful shutdown: SIGINT/SIGTERM close bot polling, HTTP server, and DB connections.
๐ค User Documentation
Everything users need to know to create and manage their pizza website.
How Users Generate a Site
- Send
/startand follow onboarding prompts. - Share GPS location to auto-detect country, currency, and phone code.
- Enter your pizzeria name and phone number.
- Use the "Add Your Pizza Menu" button to create your menu.
- Optionally add pizza images and social media links.
- Your site will be published and you'll receive the URL!
Edit Main Offer (Hero)
The offer appears in the hero section at the very top of your website. It's the first thing visitors see!
- Send
/offerto start editing. - Enter your offer title (e.g., "50% OFF TODAY!").
- Enter your offer description (e.g., "Use code PIZZA50").
- Click "Redeploy Now" to publish changes.
Change Language
- Send
/languageto see available languages. - Select your preferred language.
- Click "Apply Now" to republish your site in the new language.
Customize the Site
Pizza Menu
Use the Web App button during onboarding to enter your pizzas, prices, and categories. You can update and
republish at any time by using /customize.
Site Logo
Go to /customize โ "Change Logo" and upload your logo image. The bot will resize it automatically.
About Us Section
Use /customize โ "Edit About Us" to add a personal description and image for your restaurant.
Social Pages
Add your Facebook, Instagram, and X (Twitter) links during onboarding or via /customize.
Edit Location
Use /customize โ "Edit Location" to update your address. The map on your website will update
automatically.
Search Domain & Send to Admin
- Send
/domainto start. - Choose "Single Search" or "Bulk Search".
- Enter domain names without .com (e.g., "mypizzashop").
- If available, click "Send to Admin for Approval".
- The admin will review and link the domain to your site.
Contact Support
- Send
/supportto open the help desk. - Select the topic that matches your issue.
- Describe your problem in detail.
- The admin will respond directly to you in Telegram.
- Use "My Ticket History" to view past conversations.
Frequently Asked Questions
How much does it cost?
Creating a basic website is free! Premium features (custom domain, advanced templates, offers) require a subscription.
How do I update my menu?
Use /customize โ "Edit Menu" to add, remove, or modify your pizza items.
Can I have multiple websites?
Currently, each Telegram account can have one website. Contact support if you need additional sites.
How do customers order?
Your website has a WhatsApp button that allows customers to send orders directly to your phone number.
Is my website mobile-friendly?
Yes! All templates are fully responsive and look great on phones, tablets, and computers.