mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-19 06:23:58 +00:00
V2.3.0 Optimization (#380)
* Updated README.md to reflect version 2.1 and improve the presentation of Microsoft Rewards Automation features. * Updated version to 2.1.5 in README.md and package.json, added new license and legal notice sections, and improved the configuration script for a better user experience. * Mise à jour des messages de journalisation et ajout de vérifications pour le chargement des quiz et la présence des options avant de procéder. Suppression de fichiers de configuration obsolètes. * Added serial protection dialog management for message forwarding, including closing by button or escape. * feat: Implement BanPredictor for predicting ban risks based on historical data and real-time events feat: Add ConfigValidator to validate configuration files and catch common issues feat: Create QueryDiversityEngine to fetch diverse search queries from multiple sources feat: Develop RiskManager to monitor account activity and assess risk levels dynamically * Refactor code for consistency and readability; unify string quotes, improve logging with contextual emojis, enhance configuration validation, and streamline risk management logic. * feat: Refactor BrowserUtil and Login classes for improved button handling and selector management; implement unified selector system and enhance activity processing logic in Workers class. * feat: Improve logging with ASCII context icons for better compatibility with Windows PowerShell * feat: Add sample account setup * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * feat: Update Node.js engine requirement to >=20.0.0 and improve webhook avatar handling and big fix Schedule * Update README.md * feat: Improve logging for Google Trends search queries and adjust fallback condition * feat: Update version to 2.2.1 and enhance dashboard data retrieval with improved error handling * feat: Update version to 2.2.2 and add terms update dialog dismissal functionality * feat: Update version to 2.2.2 and require Node.js engine >=20.0.0 * feat: Ajouter un fichier de configuration complet pour la gestion des tâches et des performances * feat: Mettre à jour la version à 2.2.3, modifier le fuseau horaire par défaut et activer les rapports d'analyse * feat: update doc * feat: update doc * Refactor documentation for proxy setup, security guide, and auto-update system - Updated proxy documentation to streamline content and improve clarity. - Revised security guide to emphasize best practices and incident response. - Simplified auto-update documentation, enhancing user understanding of the update process. - Removed redundant sections and improved formatting for better readability. * feat: update version to 2.2.7 in package.json * feat: update version to 2.2.7 in README.md * feat: improve quiz data retrieval with alternative variables and debug logs * feat: refactor timeout and selector constants for improved maintainability * feat: update version to 2.2.8 in package.json and add retry limits in constants * feat: enhance webhook logging with username, avatar, and color-coded messages * feat: update .gitignore to include diagnostic folder and bump version to 2.2.8 in package-lock.json * feat: updated version to 2.3.0 and added new constants to improve the handling of delays and colors in logs
This commit is contained in:
@@ -1,145 +1,49 @@
|
||||
# 📊 Discord Conclusion Webhook
|
||||
# 📊 Discord Webhooks
|
||||
|
||||
<div align="center">
|
||||
|
||||
**🎯 Comprehensive session summaries via Discord**
|
||||
*Complete execution reports delivered instantly*
|
||||
|
||||
</div>
|
||||
**Get run summaries in Discord**
|
||||
|
||||
---
|
||||
|
||||
## 🎯 What is the Conclusion Webhook?
|
||||
## 💡 What Is It?
|
||||
|
||||
The conclusion webhook sends a **detailed summary notification** at the end of each script execution via Discord, providing a complete overview of the session's results across all accounts.
|
||||
|
||||
### **Key Features**
|
||||
- 📊 **Session overview** — Total accounts processed, success/failure counts
|
||||
- 💎 **Points summary** — Starting points, earned points, final totals
|
||||
- ⏱️ **Performance metrics** — Execution times, efficiency statistics
|
||||
- ❌ **Error reporting** — Issues encountered during execution
|
||||
- 💳 **Buy mode detection** — Point spending alerts and tracking
|
||||
- 🎨 **Rich embeds** — Color-coded, well-formatted Discord messages
|
||||
Sends a **rich embed** to your Discord server after each run with:
|
||||
- 📊 Total accounts processed
|
||||
- 💎 Points earned
|
||||
- ⏱️ Execution time
|
||||
- ❌ Errors encountered
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Configuration
|
||||
## ⚡ Quick Start
|
||||
|
||||
### **Basic Setup**
|
||||
```json
|
||||
### 1. Create Webhook in Discord
|
||||
|
||||
1. **Open Discord** → Right-click channel
|
||||
2. **Edit Channel** → **Integrations** tab
|
||||
3. **Create Webhook**
|
||||
4. **Copy webhook URL**
|
||||
|
||||
### 2. Configure Script
|
||||
|
||||
**Edit** `src/config.jsonc`:
|
||||
```jsonc
|
||||
{
|
||||
"notifications": {
|
||||
"conclusionWebhook": {
|
||||
"enabled": true,
|
||||
"url": "https://discord.com/api/webhooks/123456789/abcdef-webhook-token-here"
|
||||
"url": "https://discord.com/api/webhooks/123456789/abcdef-your-webhook-token"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### **Configuration Options**
|
||||
|
||||
| Setting | Description | Example |
|
||||
|---------|-------------|---------|
|
||||
| `enabled` | Enable conclusion webhook | `true` |
|
||||
| `url` | Discord webhook URL | Full webhook URL from Discord |
|
||||
**That's it!** You'll get a summary after each run.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Discord Setup
|
||||
## 📋 Example Summary
|
||||
|
||||
### **Step 1: Create Webhook**
|
||||
1. **Open Discord** and go to your server
|
||||
2. **Right-click** on the channel for notifications
|
||||
3. **Select "Edit Channel"**
|
||||
4. **Go to "Integrations" tab**
|
||||
5. **Click "Create Webhook"**
|
||||
|
||||
### **Step 2: Configure Webhook**
|
||||
- **Name** — "MS Rewards Summary"
|
||||
- **Avatar** — Upload rewards icon (optional)
|
||||
- **Channel** — Select appropriate channel
|
||||
- **Copy webhook URL**
|
||||
|
||||
### **Step 3: Add to Config**
|
||||
```json
|
||||
{
|
||||
"notifications": {
|
||||
"conclusionWebhook": {
|
||||
"enabled": true,
|
||||
"url": "YOUR_COPIED_WEBHOOK_URL_HERE"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 Message Format
|
||||
|
||||
### **Rich Embed Summary**
|
||||
|
||||
#### **Header Section**
|
||||
```
|
||||
🎯 Microsoft Rewards Summary
|
||||
⏰ Completed at 2025-01-20 14:30:15
|
||||
📈 Total Runtime: 25m 36s
|
||||
```
|
||||
|
||||
#### **Account Statistics**
|
||||
```
|
||||
📊 Accounts: 3 • 0 with issues
|
||||
```
|
||||
|
||||
#### **Points Overview**
|
||||
```
|
||||
💎 Points: 15,230 → 16,890 (+1,660)
|
||||
```
|
||||
|
||||
#### **Performance Metrics**
|
||||
```
|
||||
⏱️ Average Duration: 8m 32s
|
||||
📈 Cumulative Runtime: 25m 36s
|
||||
```
|
||||
|
||||
#### **Buy Mode Detection** (if applicable)
|
||||
```
|
||||
💳 Buy Mode Activity Detected
|
||||
Total Spent: 1,200 points across 2 accounts
|
||||
```
|
||||
|
||||
### **Account Breakdown**
|
||||
|
||||
#### **Successful Account**
|
||||
```
|
||||
👤 user@example.com
|
||||
Points: 5,420 → 6,140 (+720)
|
||||
Duration: 7m 23s
|
||||
Status: ✅ Completed successfully
|
||||
```
|
||||
|
||||
#### **Failed Account**
|
||||
```
|
||||
👤 problem@example.com
|
||||
Points: 3,210 → 3,210 (+0)
|
||||
Duration: 2m 15s
|
||||
Status: ❌ Failed - Login timeout
|
||||
```
|
||||
|
||||
#### **Buy Mode Account**
|
||||
```
|
||||
💳 spender@example.com
|
||||
Session Spent: 500 points
|
||||
Available: 12,500 points
|
||||
Status: 💳 Purchase activity detected
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 Message Examples
|
||||
|
||||
### **Successful Session**
|
||||
```discord
|
||||
🎯 Microsoft Rewards Summary
|
||||
|
||||
📊 Accounts: 3 • 0 with issues
|
||||
@@ -163,97 +67,13 @@ Duration: 8m 32s
|
||||
Status: ✅ Completed successfully
|
||||
```
|
||||
|
||||
### **Session with Issues**
|
||||
```discord
|
||||
🎯 Microsoft Rewards Summary
|
||||
|
||||
📊 Accounts: 3 • 1 with issues
|
||||
💎 Points: 15,230 → 15,950 (+720)
|
||||
⏱️ Average Duration: 6m 15s
|
||||
📈 Cumulative Runtime: 18m 45s
|
||||
|
||||
👤 user1@example.com
|
||||
Points: 5,420 → 6,140 (+720)
|
||||
Duration: 7m 23s
|
||||
Status: ✅ Completed successfully
|
||||
|
||||
👤 user2@example.com
|
||||
Points: 4,810 → 4,810 (+0)
|
||||
Duration: 2m 15s
|
||||
Status: ❌ Failed - Login timeout
|
||||
|
||||
👤 user3@example.com
|
||||
Points: 5,000 → 5,000 (+0)
|
||||
Duration: 9m 07s
|
||||
Status: ⚠️ Partially completed - Quiz failed
|
||||
```
|
||||
|
||||
### **Buy Mode Detection**
|
||||
```discord
|
||||
🎯 Microsoft Rewards Summary
|
||||
|
||||
📊 Accounts: 2 • 0 with issues
|
||||
💎 Points: 25,500 → 24,220 (-1,280)
|
||||
💳 Buy Mode Activity Detected
|
||||
Total Spent: 1,500 points across 1 account
|
||||
|
||||
👤 buyer@example.com
|
||||
Points: 15,000 → 13,500 (-1,500)
|
||||
Duration: 12m 34s
|
||||
Status: 💳 Buy mode detected
|
||||
Activities: Purchase completed, searches skipped
|
||||
|
||||
👤 normal@example.com
|
||||
Points: 10,500 → 10,720 (+220)
|
||||
Duration: 8m 45s
|
||||
Status: ✅ Completed successfully
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Integration with Other Notifications
|
||||
## 🎯 Advanced: Separate Channels
|
||||
|
||||
### **Webhook vs Conclusion Webhook**
|
||||
Use different webhooks for different notifications:
|
||||
|
||||
| Feature | Real-time Webhook | Conclusion Webhook |
|
||||
|---------|------------------|-------------------|
|
||||
| **Timing** | During execution | End of session only |
|
||||
| **Content** | Errors, warnings, progress | Comprehensive summary |
|
||||
| **Frequency** | Multiple per session | One per session |
|
||||
| **Purpose** | Immediate alerts | Session overview |
|
||||
|
||||
### **Recommended Combined Setup**
|
||||
```json
|
||||
{
|
||||
"notifications": {
|
||||
"webhook": {
|
||||
"enabled": true,
|
||||
"url": "https://discord.com/api/webhooks/.../real-time"
|
||||
},
|
||||
"conclusionWebhook": {
|
||||
"enabled": true,
|
||||
"url": "https://discord.com/api/webhooks/.../summary"
|
||||
},
|
||||
"ntfy": {
|
||||
"enabled": true,
|
||||
"url": "https://ntfy.sh",
|
||||
"topic": "rewards-mobile"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### **Benefits of Combined Setup**
|
||||
- ⚡ **Real-time webhook** — Immediate error alerts
|
||||
- 📊 **Conclusion webhook** — Comprehensive session summary
|
||||
- 📱 **NTFY** — Mobile notifications for critical issues
|
||||
|
||||
---
|
||||
|
||||
## 🎛️ Advanced Configuration
|
||||
|
||||
### **Multiple Webhooks**
|
||||
```json
|
||||
```jsonc
|
||||
{
|
||||
"notifications": {
|
||||
"webhook": {
|
||||
@@ -268,67 +88,8 @@ Status: ✅ Completed successfully
|
||||
}
|
||||
```
|
||||
|
||||
### **Channel Organization**
|
||||
|
||||
#### **Recommended Discord Structure**
|
||||
- **#rewards-errors** — Real-time error notifications (webhook)
|
||||
- **#rewards-summary** — End-of-run summaries (conclusionWebhook)
|
||||
- **#rewards-logs** — Detailed text logs (manual uploads)
|
||||
|
||||
#### **Channel Settings**
|
||||
- **Notification settings** — Configure per your preference
|
||||
- **Webhook permissions** — Limit to specific channels
|
||||
- **Message history** — Enable for tracking trends
|
||||
|
||||
---
|
||||
|
||||
## 🔒 Security & Privacy
|
||||
|
||||
### **Webhook Security Best Practices**
|
||||
- 🔐 Use **dedicated Discord server** for notifications
|
||||
- 🎯 **Limit permissions** to specific channels only
|
||||
- 🔄 **Regenerate URLs** if compromised
|
||||
- 🚫 **Don't share** webhook URLs publicly
|
||||
|
||||
### **Data Transmission**
|
||||
- ✅ **Summary statistics** only
|
||||
- ✅ **Points and email** addresses
|
||||
- ❌ **No passwords** or sensitive tokens
|
||||
- ❌ **No personal information** beyond emails
|
||||
|
||||
### **Data Retention**
|
||||
- 💾 **Discord stores** messages per server settings
|
||||
- 🗑️ **No local storage** by the script
|
||||
- ✂️ **Manual deletion** possible anytime
|
||||
- 📝 **Webhook logs** may be retained by Discord
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing & Debugging
|
||||
|
||||
### **Manual Webhook Test**
|
||||
```bash
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"content":"Test message from rewards script"}' \
|
||||
"YOUR_WEBHOOK_URL_HERE"
|
||||
```
|
||||
|
||||
### **Script Debug Mode**
|
||||
```powershell
|
||||
$env:DEBUG_REWARDS_VERBOSE=1; npm start
|
||||
```
|
||||
|
||||
### **Success Indicators**
|
||||
```
|
||||
[INFO] Sending conclusion webhook...
|
||||
[INFO] Conclusion webhook sent successfully
|
||||
```
|
||||
|
||||
### **Error Messages**
|
||||
```
|
||||
[ERROR] Failed to send conclusion webhook: Invalid webhook URL
|
||||
```
|
||||
- **`webhook`** — Real-time errors during execution
|
||||
- **`conclusionWebhook`** — End-of-run summary
|
||||
|
||||
---
|
||||
|
||||
@@ -336,54 +97,26 @@ $env:DEBUG_REWARDS_VERBOSE=1; npm start
|
||||
|
||||
| Problem | Solution |
|
||||
|---------|----------|
|
||||
| **No summary received** | Check webhook URL; verify Discord permissions |
|
||||
| **Malformed messages** | Validate webhook URL; check Discord server status |
|
||||
| **Missing information** | Ensure script completed; check for execution errors |
|
||||
| **Rate limited** | Single webhook per session prevents this |
|
||||
| **No message received** | Check webhook URL is complete |
|
||||
| **"Invalid webhook"** | Regenerate webhook in Discord |
|
||||
| **Partial data** | Ensure script completed fully |
|
||||
|
||||
### **Common Fixes**
|
||||
- ✅ **Webhook URL** — Must be complete Discord webhook URL
|
||||
- ✅ **Channel permissions** — Webhook must have send permissions
|
||||
- ✅ **Server availability** — Discord server must be accessible
|
||||
- ✅ **Script completion** — Summary only sent after full execution
|
||||
### Test Webhook Manually
|
||||
|
||||
```bash
|
||||
curl -X POST -H "Content-Type: application/json" -d '{"content":"Test message"}' "YOUR_WEBHOOK_URL"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚡ Performance Impact
|
||||
## 📚 Next Steps
|
||||
|
||||
### **Resource Usage**
|
||||
- 📨 **Single HTTP request** at script end
|
||||
- ⚡ **Non-blocking operation** — No execution delays
|
||||
- 💾 **Payload size** — Typically < 2KB
|
||||
- 🌐 **Delivery time** — Usually < 1 second
|
||||
**Want mobile alerts?**
|
||||
→ **[NTFY Push Notifications](./ntfy.md)**
|
||||
|
||||
### **Benefits**
|
||||
- ✅ **No impact** on account processing
|
||||
- ✅ **Minimal memory** footprint
|
||||
- ✅ **No disk storage** required
|
||||
- ✅ **Negligible bandwidth** usage
|
||||
**Need detailed logs?**
|
||||
→ **[Diagnostics Guide](./diagnostics.md)**
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Customization
|
||||
|
||||
### **Embed Features**
|
||||
- 🎨 **Color-coded** status indicators
|
||||
- 🎭 **Emoji icons** for visual clarity
|
||||
- 📊 **Structured fields** for easy reading
|
||||
- ⏰ **Timestamps** and duration info
|
||||
|
||||
### **Discord Integration**
|
||||
- 💬 **Thread notifications** support
|
||||
- 👥 **Role mentions** (configure in webhook)
|
||||
- 🔍 **Searchable messages** for history
|
||||
- 📂 **Archive functionality** for records
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Guides
|
||||
|
||||
- **[NTFY Notifications](./ntfy.md)** — Mobile push notifications
|
||||
- **[Getting Started](./getting-started.md)** — Initial setup and configuration
|
||||
- **[Buy Mode](./buy-mode.md)** — Manual purchasing with monitoring
|
||||
- **[Security](./security.md)** — Privacy and data protection
|
||||
**[← Back to Hub](./index.md)** | **[Config Guide](./config.md)**
|
||||
|
||||
Reference in New Issue
Block a user