# Quick Installation Guide

## Step 1: Upload Files

Upload all PHP files to your web server at `https://up-1.ebot.top/`

Required files:
- `config.php`
- `database.php`
- `functions.php`
- `webhook.php`
- `setup.php`
- `.htaccess` (for security)

## Step 2: Configure

The `config.php` is already configured with your settings:
- API_ID: 2815084
- API_HASH: 6e64163bfb52621e86c0d4d6137a66d1
- BOT_TOKEN: 8151782652:AAHrxFNQMP_wS9vsAl4FfsQLdaqwpyHf4I
- Admin IDs: 1389610583, 1997074793, 7087757135
- Webhook URL: https://up-1.ebot.top/webhook.php

## Step 3: Run Setup

Visit in your browser:
```
https://up-1.ebot.top/setup.php
```

Or run via command line:
```bash
php setup.php
```

This will:
- Create the database (bot6-real.db)
- Set the webhook
- Display bot information

## Step 4: Test

1. Open Telegram
2. Find your bot
3. Send `/start`
4. You should see the admin panel

## Step 5: Security (Important!)

After successful setup, DELETE the setup.php file:
```bash
rm setup.php
```

Or via FTP, delete the file from your server.

## Troubleshooting

If the bot doesn't respond:

1. Check webhook info:
   ```
   https://api.telegram.org/bot8151782652:AAHrxFNQMP_wS9vsAl4FfsQLdaqwpyHf4I/getWebhookInfo
   ```

2. Check error logs:
   - `error.log` on your server
   - `updates.log` (if DEBUG_MODE is enabled)

3. Verify webhook.php is accessible:
   ```
   curl https://up-1.ebot.top/webhook.php
   ```

4. Make sure your server supports:
   - PHP 8.1+
   - PDO SQLite
   - cURL
   - HTTPS

## File Permissions

Make sure these files are writable:
```bash
chmod 666 bot6-real.db
chmod 666 admin_states.json
chmod 666 error.log
chmod 666 updates.log
```

## Using Existing Python Database

If you have an existing `bot6-real.db` from the Python version:
1. Upload it to the same directory as the PHP files
2. Make sure it's writable (chmod 666)
3. The PHP version will use the existing data

## What's Next?

- Upload files: Use "📦 اپلود فایل"
- Manage channels: Use "🔮قفل کانال"
- View stats: Use "📊 آمار ربات"
- Broadcast: Use "💌 ارسال همگانی" or "📬فوروارد همگانی"

Enjoy your bot! 🎉

