mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 09:16:16 +00:00
fix: Revert version to 2.59.0 and update .dockerignore to exclude compose.yaml
This commit is contained in:
@@ -3,8 +3,6 @@ node_modules/
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
# Let Docker generate platform-specific lockfile
|
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# Build outputs
|
# Build outputs
|
||||||
dist/
|
dist/
|
||||||
@@ -52,11 +50,11 @@ browser/
|
|||||||
.eslintcache
|
.eslintcache
|
||||||
setup/
|
setup/
|
||||||
|
|
||||||
# Docker files (organized in docker/ folder - no recursion needed)
|
# Docker files - Keep docker/ folder for COPY commands but exclude compose.yaml
|
||||||
docker/
|
docker/compose.yaml
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
|
||||||
# Scripts installer (not needed in Docker, but keep docker/ folder)
|
# Scripts installer (not needed in Docker)
|
||||||
scripts/installer/
|
scripts/installer/
|
||||||
scripts/README.md
|
scripts/README.md
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "2.60.0",
|
"version": "2.59.0",
|
||||||
"description": "Automate Microsoft Rewards points collection",
|
"description": "Automate Microsoft Rewards points collection",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -72,55 +72,32 @@ export class SummaryReporter {
|
|||||||
const totalFinal = summary.accounts.reduce((sum, acc) => sum + acc.finalPoints, 0)
|
const totalFinal = summary.accounts.reduce((sum, acc) => sum + acc.finalPoints, 0)
|
||||||
const bannedCount = summary.accounts.filter(acc => acc.banned).length
|
const bannedCount = summary.accounts.filter(acc => acc.banned).length
|
||||||
|
|
||||||
// Build structured embed description
|
// Build clean, Discord-optimized description
|
||||||
let description = `┌${'─'.repeat(48)}┐\n`
|
let description = `**⏱️ Duration:** ${durationText}\n`
|
||||||
description += `│ ${' '.repeat(10)}📊 EXECUTION SUMMARY${' '.repeat(11)}│\n`
|
description += `**💰 Total Earned:** ${summary.totalPoints} points\n`
|
||||||
description += `└${'─'.repeat(48)}┘\n\n`
|
description += `**🖥️ Desktop:** ${totalDesktop} pts | **📱 Mobile:** ${totalMobile} pts\n`
|
||||||
|
description += `**✅ Success:** ${summary.successCount}/${summary.accounts.length}`
|
||||||
|
|
||||||
// Global Overview
|
|
||||||
description += `**🌐 GLOBAL STATISTICS**\n`
|
|
||||||
description += `┌${'─'.repeat(48)}┐\n`
|
|
||||||
description += `│ ⏱️ Duration: \`${durationText}\`${' '.repeat(48 - 14 - durationText.length)}│\n`
|
|
||||||
description += `│ 💰 Total Earned: **${summary.totalPoints}** points${' '.repeat(48 - 22 - String(summary.totalPoints).length)}│\n`
|
|
||||||
description += `│ 🖥️ Desktop: **${totalDesktop}** pts | 📱 Mobile: **${totalMobile}** pts${' '.repeat(48 - 28 - String(totalDesktop).length - String(totalMobile).length)}│\n`
|
|
||||||
description += `│ ✅ Success: ${summary.successCount}/${summary.accounts.length} accounts${' '.repeat(48 - 18 - String(summary.successCount).length - String(summary.accounts.length).length)}│\n`
|
|
||||||
if (summary.failureCount > 0) {
|
if (summary.failureCount > 0) {
|
||||||
description += `│ ❌ Failed: ${summary.failureCount} accounts${' '.repeat(48 - 14 - String(summary.failureCount).length)}│\n`
|
description += ` | **❌ Failed:** ${summary.failureCount}`
|
||||||
}
|
}
|
||||||
if (bannedCount > 0) {
|
if (bannedCount > 0) {
|
||||||
description += `│ 🚫 Banned: ${bannedCount} accounts${' '.repeat(48 - 14 - String(bannedCount).length)}│\n`
|
description += ` | **🚫 Banned:** ${bannedCount}`
|
||||||
}
|
}
|
||||||
description += `└${'─'.repeat(48)}┘\n\n`
|
|
||||||
|
|
||||||
// Account Details
|
description += `\n\n**📊 Account Details**\n`
|
||||||
description += `**📄 ACCOUNT BREAKDOWN**\n\n`
|
|
||||||
|
|
||||||
const accountsWithErrors: AccountResult[] = []
|
const accountsWithErrors: AccountResult[] = []
|
||||||
|
|
||||||
for (const account of summary.accounts) {
|
for (const account of summary.accounts) {
|
||||||
const status = account.banned ? '🚫' : (account.errors?.length ? '❌' : '✅')
|
const status = account.banned ? '🚫' : (account.errors?.length ? '❌' : '✅')
|
||||||
const emailShort = account.email.length > 30 ? account.email.substring(0, 27) + '...' : account.email
|
const emailShort = account.email.length > 35 ? account.email.substring(0, 32) + '...' : account.email
|
||||||
const durationSec = Math.round(account.runDuration / 1000)
|
const durationSec = Math.round(account.runDuration / 1000)
|
||||||
|
|
||||||
description += `${status} **${emailShort}**\n`
|
description += `\n${status} **${emailShort}**\n`
|
||||||
description += `┌${'─'.repeat(46)}┐\n`
|
description += `• Points: **+${account.pointsEarned}** (🖥️ ${account.desktopPoints} | 📱 ${account.mobilePoints})\n`
|
||||||
|
description += `• Balance: ${account.initialPoints} → **${account.finalPoints}** pts\n`
|
||||||
// Points Earned Breakdown
|
description += `• Duration: ${durationSec}s\n`
|
||||||
description += `│ 📊 Points Earned: **+${account.pointsEarned}** points${' '.repeat(46 - 23 - String(account.pointsEarned).length)}│\n`
|
|
||||||
description += `│ └─ Desktop: **${account.desktopPoints}** pts${' '.repeat(46 - 20 - String(account.desktopPoints).length)}│\n`
|
|
||||||
description += `│ └─ Mobile: **${account.mobilePoints}** pts${' '.repeat(46 - 19 - String(account.mobilePoints).length)}│\n`
|
|
||||||
description += `├${'─'.repeat(46)}┤\n`
|
|
||||||
|
|
||||||
// Account Total Balance (formula)
|
|
||||||
description += `│ 💳 Account Total Balance${' '.repeat(23)}│\n`
|
|
||||||
description += `│ \`${account.initialPoints}\` + \`${account.pointsEarned}\` = **\`${account.finalPoints}\` pts**${' '.repeat(46 - 17 - String(account.initialPoints).length - String(account.pointsEarned).length - String(account.finalPoints).length)}│\n`
|
|
||||||
description += `│ (Initial + Earned = Final)${' '.repeat(18)}│\n`
|
|
||||||
description += `├${'─'.repeat(46)}┤\n`
|
|
||||||
|
|
||||||
// Duration
|
|
||||||
description += `│ ⏱️ Duration: ${durationSec}s${' '.repeat(46 - 13 - String(durationSec).length)}│\n`
|
|
||||||
|
|
||||||
description += `└${'─'.repeat(46)}┘\n\n`
|
|
||||||
|
|
||||||
// Collect accounts with errors for separate webhook
|
// Collect accounts with errors for separate webhook
|
||||||
if ((account.errors?.length || account.banned) && account.email) {
|
if ((account.errors?.length || account.banned) && account.email) {
|
||||||
@@ -129,13 +106,8 @@ export class SummaryReporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Footer summary
|
// Footer summary
|
||||||
description += `┌${'─'.repeat(48)}┐\n`
|
description += `\n**🌐 Total Balance**\n`
|
||||||
description += `│ 🌐 TOTAL ACROSS ALL ACCOUNTS${' '.repeat(22)}│\n`
|
description += `${totalInitial} → **${totalFinal}** pts (+${summary.totalPoints})`
|
||||||
description += `├${'─'.repeat(48)}┤\n`
|
|
||||||
description += `│ Initial Balance: \`${totalInitial}\` points${' '.repeat(48 - 25 - String(totalInitial).length)}│\n`
|
|
||||||
description += `│ Final Balance: \`${totalFinal}\` points${' '.repeat(48 - 23 - String(totalFinal).length)}│\n`
|
|
||||||
description += `│ Total Earned: **+${summary.totalPoints}** points${' '.repeat(48 - 23 - String(summary.totalPoints).length)}│\n`
|
|
||||||
description += `└${'─'.repeat(48)}┘\n`
|
|
||||||
|
|
||||||
const color = bannedCount > 0 ? 0xFF0000 : summary.failureCount > 0 ? 0xFFAA00 : 0x00FF00
|
const color = bannedCount > 0 ? 0xFF0000 : summary.failureCount > 0 ? 0xFFAA00 : 0x00FF00
|
||||||
|
|
||||||
@@ -162,52 +134,33 @@ export class SummaryReporter {
|
|||||||
*/
|
*/
|
||||||
private async sendErrorReport(accounts: AccountResult[]): Promise<void> {
|
private async sendErrorReport(accounts: AccountResult[]): Promise<void> {
|
||||||
try {
|
try {
|
||||||
let errorDescription = `┌${'─'.repeat(48)}┐\n`
|
let errorDescription = `**${accounts.length} account(s) encountered issues:**\n\n`
|
||||||
errorDescription += `│ ${' '.repeat(10)}⚠️ ERROR REPORT${' '.repeat(16)}│\n`
|
|
||||||
errorDescription += `└${'─'.repeat(48)}┘\n\n`
|
|
||||||
|
|
||||||
errorDescription += `**${accounts.length} account(s) encountered issues:**\n\n`
|
|
||||||
|
|
||||||
for (const account of accounts) {
|
for (const account of accounts) {
|
||||||
const status = account.banned ? '🚫 BANNED' : '❌ ERROR'
|
const status = account.banned ? '🚫 BANNED' : '❌ ERROR'
|
||||||
const emailShort = account.email.length > 35 ? account.email.substring(0, 32) + '...' : account.email
|
const emailShort = account.email.length > 40 ? account.email.substring(0, 37) + '...' : account.email
|
||||||
|
|
||||||
errorDescription += `${status} | **${emailShort}**\n`
|
errorDescription += `${status} **${emailShort}**\n`
|
||||||
errorDescription += `┌${'─'.repeat(46)}┐\n`
|
errorDescription += `• Progress: ${account.pointsEarned} pts (🖥️ ${account.desktopPoints} | 📱 ${account.mobilePoints})\n`
|
||||||
|
|
||||||
// Show what was attempted
|
|
||||||
errorDescription += `│ 📊 Progress${' '.repeat(35)}│\n`
|
|
||||||
errorDescription += `│ Desktop: ${account.desktopPoints} pts earned${' '.repeat(46 - 21 - String(account.desktopPoints).length)}│\n`
|
|
||||||
errorDescription += `│ Mobile: ${account.mobilePoints} pts earned${' '.repeat(46 - 20 - String(account.mobilePoints).length)}│\n`
|
|
||||||
errorDescription += `│ Total: ${account.pointsEarned} pts${' '.repeat(46 - 13 - String(account.pointsEarned).length)}│\n`
|
|
||||||
errorDescription += `├${'─'.repeat(46)}┤\n`
|
|
||||||
|
|
||||||
// Error details
|
// Error details
|
||||||
if (account.banned) {
|
if (account.banned) {
|
||||||
errorDescription += `│ 🚫 Status: Account Banned/Suspended${' '.repeat(9)}│\n`
|
errorDescription += `• Status: Account Banned/Suspended\n`
|
||||||
if (account.errors?.length && account.errors[0]) {
|
if (account.errors?.length && account.errors[0]) {
|
||||||
errorDescription += `│ 💬 Reason:${' '.repeat(36)}│\n`
|
errorDescription += `• Reason: ${account.errors[0]}\n`
|
||||||
const lines = this.wrapText(account.errors[0], 42)
|
|
||||||
for (const line of lines) {
|
|
||||||
errorDescription += `│ ${line}${' '.repeat(46 - 3 - line.length)}│\n`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (account.errors?.length && account.errors[0]) {
|
} else if (account.errors?.length && account.errors[0]) {
|
||||||
errorDescription += `│ ❌ Error Details:${' '.repeat(29)}│\n`
|
errorDescription += `• Error: ${account.errors[0]}\n`
|
||||||
const lines = this.wrapText(account.errors[0], 42)
|
|
||||||
for (const line of lines) {
|
|
||||||
errorDescription += `│ ${line}${' '.repeat(46 - 3 - line.length)}│\n`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
errorDescription += `└${'─'.repeat(46)}┘\n\n`
|
errorDescription += `\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
errorDescription += `**📋 Recommended Actions:**\n`
|
errorDescription += `**📋 Recommended Actions:**\n`
|
||||||
errorDescription += `• Check account status manually\n`
|
errorDescription += `• Check account status manually\n`
|
||||||
errorDescription += `• Review error messages above\n`
|
errorDescription += `• Review error messages above\n`
|
||||||
errorDescription += `• Verify credentials if login failed\n`
|
errorDescription += `• Verify credentials if login failed\n`
|
||||||
errorDescription += `• Consider proxy rotation if rate-limited\n`
|
errorDescription += `• Consider proxy rotation if rate-limited`
|
||||||
|
|
||||||
await ConclusionWebhook(
|
await ConclusionWebhook(
|
||||||
this.config,
|
this.config,
|
||||||
@@ -221,27 +174,6 @@ export class SummaryReporter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Wrap text to fit within specified width
|
|
||||||
*/
|
|
||||||
private wrapText(text: string, maxWidth: number): string[] {
|
|
||||||
const words = text.split(' ')
|
|
||||||
const lines: string[] = []
|
|
||||||
let currentLine = ''
|
|
||||||
|
|
||||||
for (const word of words) {
|
|
||||||
if ((currentLine + word).length > maxWidth) {
|
|
||||||
if (currentLine) lines.push(currentLine.trim())
|
|
||||||
currentLine = word + ' '
|
|
||||||
} else {
|
|
||||||
currentLine += word + ' '
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentLine.trim()) lines.push(currentLine.trim())
|
|
||||||
return lines
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send push notification via Ntfy
|
* Send push notification via Ntfy
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user