mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 14:19:40 +02:00
refactor(stats-bot): swap commands - !stats for personal, !global for global
- !stats now shows personal stats (requires login) - !global now shows global Umami analytics - Update keywords and help text accordingly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
12451092f1
commit
139c04040d
2 changed files with 15 additions and 15 deletions
|
|
@ -26,14 +26,14 @@ pnpm type-check # TypeScript check
|
|||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `!mystats` | Your personal statistics across all ManaCore apps |
|
||||
| `!stats` | Your personal statistics across all ManaCore apps |
|
||||
| `!status` | Account status and credit balance |
|
||||
|
||||
### Global Analytics (Umami)
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `!stats` | Overview of all apps (30 days) |
|
||||
| `!global` | Overview of all apps (30 days) |
|
||||
| `!today` | Today's statistics |
|
||||
| `!week` | This week's statistics |
|
||||
| `!realtime` | Active visitors right now |
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ export class MatrixService extends BaseMatrixService {
|
|||
|
||||
private readonly keywordDetector = new KeywordCommandDetector([
|
||||
...COMMON_KEYWORDS,
|
||||
{ keywords: ['stats', 'statistik', 'statistiken', 'uebersicht'], command: 'stats' },
|
||||
{ keywords: ['stats', 'statistik', 'statistiken', 'meinestats', 'mydata'], command: 'stats' },
|
||||
{ keywords: ['global', 'alle', 'gesamt', 'uebersicht', 'overview'], command: 'global' },
|
||||
{ keywords: ['heute', 'today', 'tagesstatistik'], command: 'today' },
|
||||
{ keywords: ['woche', 'week', 'wochenstatistik'], command: 'week' },
|
||||
{ keywords: ['realtime', 'live', 'aktive', 'jetzt'], command: 'realtime' },
|
||||
|
|
@ -29,7 +30,6 @@ export class MatrixService extends BaseMatrixService {
|
|||
{ keywords: ['traffic', 'requests', 'http', 'api'], command: 'traffic' },
|
||||
{ keywords: ['db', 'database', 'datenbank', 'postgres', 'redis'], command: 'db' },
|
||||
{ keywords: ['growth', 'wachstum', 'registrierungen'], command: 'growth' },
|
||||
{ keywords: ['mystats', 'meinestats', 'meinedaten', 'mydata'], command: 'mystats' },
|
||||
]);
|
||||
|
||||
constructor(
|
||||
|
|
@ -110,7 +110,11 @@ export class MatrixService extends BaseMatrixService {
|
|||
break;
|
||||
|
||||
case 'stats':
|
||||
await this.sendStats(roomId);
|
||||
await this.sendMyStats(roomId, sender);
|
||||
break;
|
||||
|
||||
case 'global':
|
||||
await this.sendGlobalStats(roomId);
|
||||
break;
|
||||
|
||||
case 'today':
|
||||
|
|
@ -149,10 +153,6 @@ export class MatrixService extends BaseMatrixService {
|
|||
await this.sendGrowth(roomId);
|
||||
break;
|
||||
|
||||
case 'mystats':
|
||||
await this.sendMyStats(roomId, sender);
|
||||
break;
|
||||
|
||||
default:
|
||||
await this.sendMessage(roomId, `Unbekannter Befehl: !${command}\n\nVerwende !help`);
|
||||
}
|
||||
|
|
@ -161,12 +161,12 @@ export class MatrixService extends BaseMatrixService {
|
|||
private async sendHelp(roomId: string) {
|
||||
const helpText = `**📊 ManaCore Stats Bot**
|
||||
|
||||
**Persönliche Stats:**
|
||||
- \`!mystats\` - Deine persönlichen Statistiken
|
||||
- \`!status\` - Account Status
|
||||
**Deine Stats:**
|
||||
- \`!stats\` - Deine persönlichen Statistiken
|
||||
- \`!status\` - Account Status & Credits
|
||||
|
||||
**Globale Analytics (Umami):**
|
||||
- \`!stats\` - Übersicht aller Apps (30 Tage)
|
||||
- \`!global\` - Übersicht aller Apps (30 Tage)
|
||||
- \`!today\` - Heutige Statistiken
|
||||
- \`!week\` - Wochenstatistiken
|
||||
- \`!realtime\` - Aktive Besucher jetzt
|
||||
|
|
@ -186,8 +186,8 @@ export class MatrixService extends BaseMatrixService {
|
|||
await this.sendMessage(roomId, helpText);
|
||||
}
|
||||
|
||||
private async sendStats(roomId: string) {
|
||||
await this.sendMessage(roomId, '📊 Lade Statistiken...');
|
||||
private async sendGlobalStats(roomId: string) {
|
||||
await this.sendMessage(roomId, '📊 Lade globale Statistiken...');
|
||||
try {
|
||||
const report = await this.analyticsService.generateStatsOverview();
|
||||
await this.sendMessage(roomId, report);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue