QR Fix
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This guide explains how to configure users to be added to newly created groups and manage backup QR code replication via the bot.
|
||||
This guide explains how to configure users to be added to newly created groups and manage GroupHelp backup QR data via the bot.
|
||||
|
||||
## Setting Up Default Users for New Groups
|
||||
|
||||
@@ -127,26 +127,19 @@ This will create ProjectBeta with only alice and bob, regardless of the default
|
||||
|
||||
---
|
||||
|
||||
## QR Code Backup Configuration
|
||||
## GroupHelp QR Backup Configuration
|
||||
|
||||
### What is QR Backup Data?
|
||||
|
||||
QR backup data is a code that can be used to replicate or restore your bot's session across multiple instances. This is useful for:
|
||||
- Disaster recovery
|
||||
- Multi-instance deployment
|
||||
- Session migration
|
||||
- Backup and restore scenarios
|
||||
QR backup data is the GroupHelp settings backup payload generated by GroupHelp itself. It is used to copy GroupHelp settings, such as welcome-message configuration, from one group to another by pasting the QR payload as the body of a `.importbackup` message.
|
||||
|
||||
### Step 1: Generate or Obtain QR Code
|
||||
|
||||
Depending on your setup, you might have a QR code from:
|
||||
- Bot session export
|
||||
- Backup file
|
||||
- Another instance
|
||||
Generate the QR backup from GroupHelp in the source group, then store the decoded/pasted payload here so it can be reused when importing those settings into another group.
|
||||
|
||||
### Step 2: Set QR Backup Data
|
||||
### Step 2: Set GroupHelp QR Backup Data
|
||||
|
||||
Store the QR backup data in the database:
|
||||
Store the GroupHelp QR backup data in the database:
|
||||
|
||||
```
|
||||
/set_qr_backup YOUR_QR_CODE_HERE
|
||||
@@ -164,9 +157,9 @@ Response:
|
||||
Data: `0001a8ac0123456789abcdef0123456789abcdef01234567`
|
||||
```
|
||||
|
||||
### Step 3: Retrieve QR Backup Data
|
||||
### Step 3: Retrieve GroupHelp QR Backup Data
|
||||
|
||||
Retrieve the stored QR backup data anytime:
|
||||
Retrieve the stored GroupHelp QR backup data anytime:
|
||||
|
||||
```
|
||||
/get_qr_backup
|
||||
@@ -178,13 +171,12 @@ Response:
|
||||
`0001a8ac0123456789abcdef0123456789abcdef01234567`
|
||||
```
|
||||
|
||||
### Step 4: Use QR Backup for Replication
|
||||
### Step 4: Use QR Backup with GroupHelp
|
||||
|
||||
Once you have the QR backup data stored, you can:
|
||||
1. Export it from the database
|
||||
2. Use it in deployment scripts
|
||||
3. Pass it to other bot instances
|
||||
4. Store it in version control (encrypted) for DR purposes
|
||||
1. Retrieve it with `/get_qr_backup`
|
||||
2. Paste it into the target group as the message body for `.importbackup`
|
||||
3. Let GroupHelp import the backed-up settings into that group
|
||||
|
||||
---
|
||||
|
||||
@@ -201,7 +193,7 @@ The configuration data is stored in MongoDB with the following structure:
|
||||
}
|
||||
```
|
||||
|
||||
### QR Backup Collection (`COLLECTION_NAME`)
|
||||
### GroupHelp QR Backup Collection (`COLLECTION_NAME`)
|
||||
```json
|
||||
{
|
||||
"_id": ObjectId(...),
|
||||
@@ -245,18 +237,14 @@ The configuration data is stored in MongoDB with the following structure:
|
||||
/create_group NewProject
|
||||
```
|
||||
|
||||
### Workflow 3: QR Code Backup & Restore
|
||||
### Workflow 3: GroupHelp QR Backup Import
|
||||
|
||||
```bash
|
||||
# On source instance:
|
||||
# Retrieve the stored GroupHelp QR payload:
|
||||
/get_qr_backup
|
||||
# Copy the QR code output
|
||||
|
||||
# On target instance:
|
||||
/set_qr_backup <paste_qr_code_here>
|
||||
|
||||
# Verify it was stored
|
||||
/get_qr_backup
|
||||
# In the target group, paste the payload with:
|
||||
.importbackup <paste_qr_code_here>
|
||||
```
|
||||
|
||||
---
|
||||
@@ -275,7 +263,7 @@ The configuration data is stored in MongoDB with the following structure:
|
||||
2. Verify users exist: `/users`
|
||||
3. Manually add users to group: `/add_users <group_id> <user_id1>,<user_id2>`
|
||||
|
||||
### Issue: QR backup data appears empty
|
||||
### Issue: GroupHelp QR backup data appears empty
|
||||
**Solution:**
|
||||
1. Check if data was stored: `/get_qr_backup`
|
||||
2. Re-set the data: `/set_qr_backup <your_qr_code>`
|
||||
@@ -321,8 +309,8 @@ FACTORY_BOT_ID=your_bot_id
|
||||
- `/set_default_users <id1> <id2> ...` - Set default users (replace)
|
||||
- `/add_default_users <id1> <id2> ...` - Add users to default list
|
||||
- `/remove_default_users <id1> <id2> ...` - Remove users from default list
|
||||
- `/get_qr_backup` - View QR backup data
|
||||
- `/set_qr_backup <data>` - Set QR backup data
|
||||
- `/get_qr_backup` - View GroupHelp QR backup data
|
||||
- `/set_qr_backup <data>` - Set GroupHelp QR backup data
|
||||
- `/config_help` - Show configuration command help
|
||||
- `/help` - Show all available commands
|
||||
|
||||
@@ -366,19 +354,18 @@ mongo mongodb://localhost:27017/groupfactory
|
||||
# View default users
|
||||
db.group_config.find()
|
||||
|
||||
# View QR backup
|
||||
# View GroupHelp QR backup
|
||||
db.ghconfig.find({key: 'qr_backup_data'})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Security Considerations
|
||||
## Operational Notes
|
||||
|
||||
1. **Never share QR backup data** in public channels or version control
|
||||
2. **Encrypt sensitive data** before storing in version control
|
||||
3. **Rotate credentials regularly** especially after backups
|
||||
4. **Limit bot access** to trusted chats only
|
||||
5. **Monitor command usage** for suspicious activity
|
||||
1. QR backup data is a GroupHelp configuration payload, not a Telegram or Telethon session.
|
||||
2. Use `.importbackup` in the target group to import the stored GroupHelp settings.
|
||||
3. Limit configuration commands to trusted chats so group settings are changed intentionally.
|
||||
4. Monitor command usage if multiple operators manage the same groups.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user