waengine 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,271 @@
1
+ # 🔌 WAEngine Plugin System
2
+
3
+ Das WAEngine Plugin System ermöglicht es, den Bot mit modularen Plugins zu erweitern. **Plugins sind optional** und werden nur geladen, wenn explizit aufgerufen!
4
+
5
+ ## 📦 Verfügbare Plugins (8 Plugins)
6
+
7
+ ### 💰 Economy System
8
+ **Beschreibung:** Vollständiges Wirtschaftssystem mit Coins, Shop und Belohnungen
9
+ **Commands:**
10
+ - `!balance` - Kontostand anzeigen
11
+ - `!daily` - Tägliche Belohnung (100-500 Coins)
12
+ - `!work` - Arbeiten gehen (50-200 Coins)
13
+ - `!shop` - Shop mit Items anzeigen
14
+ - `!buy <id>` - Item kaufen
15
+ - `!transfer @user <amount>` - Coins übertragen
16
+ - `!leaderboard` - Top 10 reichste User
17
+
18
+ ### 🎮 Games Plugin
19
+ **Beschreibung:** Verschiedene Spiele und Unterhaltung
20
+ **Commands:**
21
+ - `!dice [seiten]` - Würfel werfen (Standard: 6 Seiten)
22
+ - `!flip` - Münze werfen
23
+ - `!rps <rock/paper/scissors>` - Schere-Stein-Papier
24
+ - `!quiz` - Quiz mit zufälligen Fragen
25
+ - `!number` - Zahlenraten-Spiel
26
+ - `!8ball <frage>` - Magische 8-Ball Antworten
27
+
28
+ ### 🎵 Music Plugin
29
+ **Beschreibung:** Musik-Suche und YouTube Integration
30
+ **Commands:**
31
+ - `!play <song>` - Musik auf YouTube suchen
32
+ - `!lyrics <song>` - Songtexte finden
33
+ - `!playlist` - Persönliche Playlist verwalten
34
+ - `!playlist add <song>` - Song zur Playlist hinzufügen
35
+ - `!playlist show` - Playlist anzeigen
36
+ - `!trending` - Trending Musik anzeigen
37
+
38
+ ### ✈️ Travel Plugin
39
+ **Beschreibung:** Reise-Informationen und Wetter
40
+ **Commands:**
41
+ - `!weather <stadt>` - Aktuelles Wetter
42
+ - `!forecast <stadt>` - 5-Tage Wettervorhersage
43
+ - `!flight <von> <nach>` - Flugsuche
44
+ - `!hotel <stadt>` - Hotel-Empfehlungen
45
+ - `!currency <von> <nach> <betrag>` - Währungsrechner
46
+ - `!travel <stadt>` - Reise-Tipps
47
+
48
+ ### 📚 Education Plugin
49
+ **Beschreibung:** Bildungs-Tools und Lernhilfen
50
+ **Commands:**
51
+ - `!wiki <begriff>` - Wikipedia-Artikel suchen
52
+ - `!define <wort>` - Wort-Definition
53
+ - `!math <ausdruck>` - Mathematische Berechnungen
54
+ - `!code <code>` - Code-Erklärungen
55
+ - `!learn [thema]` - Lernressourcen
56
+ - `!fact` - Zufällige Fakten
57
+ - `!study start/stop` - Lernzeit tracken
58
+
59
+ ### 🛡️ Moderation Plugin
60
+ **Beschreibung:** Erweiterte Moderation und Auto-Mod
61
+ **Commands:**
62
+ - `!warn @user [grund]` - User warnen
63
+ - `!unwarn @user` - Warnung entfernen
64
+ - `!warnings [@user]` - Warnungen anzeigen
65
+ - `!kick @user [grund]` - User kicken
66
+ - `!automod [on/off]` - Auto-Moderation verwalten
67
+ - `!modstats` - Moderations-Statistiken
68
+ - `!rules` - Gruppenregeln anzeigen
69
+ - `!setrules <regel1> | <regel2>` - Regeln festlegen
70
+ - `!purge <anzahl>` - Nachrichten löschen
71
+
72
+ **Auto-Moderation Features:**
73
+ - Spam-Erkennung (5 Nachrichten in 10 Sekunden)
74
+ - Verbotene Wörter Filter
75
+ - Zu viele Großbuchstaben (>70%)
76
+ - Zu viele Emojis (>10)
77
+ - Automatische Warnungen und Kicks
78
+
79
+ ### 🎨 Creative Plugin
80
+ **Beschreibung:** Kreative Tools für Memes, ASCII-Art und mehr
81
+ **Commands:**
82
+ - `!meme <nummer> <text>` - Meme mit Templates erstellen
83
+ - `!quote` - Inspirierende Zitate
84
+ - `!ascii <typ>` - ASCII-Art (heart, star, smile, cat, dog)
85
+ - `!textart <text>` - Großer Text-Art
86
+ - `!colortext <text> [stil]` - Bunter Text (rainbow, fire, ocean, nature, space)
87
+ - `!fact` - Unglaubliche Fakten
88
+ - `!joke` - Lustige Witze
89
+ - `!story` - Story-Prompt Generator
90
+ - `!inspire` - Zufällige Inspiration
91
+
92
+ ### 📊 Analytics Plugin
93
+ **Beschreibung:** Detaillierte Statistiken und Analytics
94
+ **Commands:**
95
+ - `!stats [@user]` - User-Statistiken
96
+ - `!mystats` - Eigene Statistiken
97
+ - `!groupstats` - Gruppen-Statistiken
98
+ - `!globalstats` - Globale Statistiken
99
+ - `!topusers [anzahl]` - Top User nach Nachrichten
100
+ - `!topgroups [anzahl]` - Top Gruppen
101
+ - `!topcommands [anzahl]` - Meist genutzte Commands
102
+ - `!heatmap [me/group]` - Aktivitäts-Heatmap
103
+ - `!export` - Persönliche Daten exportieren
104
+
105
+ **Tracking Features:**
106
+ - Nachrichten-Anzahl und Zeichen
107
+ - Stunden- und Tages-Aktivität
108
+ - Command-Nutzung
109
+ - Medien-Nachrichten
110
+ - Gruppen-Aktivität
111
+
112
+ ## 🚀 Plugin System Features
113
+
114
+ ### Optionales Laden
115
+ - Plugins werden nur geladen wenn explizit aufgerufen
116
+ - Verwende `client.load.Plugins("plugin-name")` zum Laden
117
+ - Ohne Aufruf: KEINE Plugins geladen
118
+ - Bessere Performance und Kontrolle
119
+ - Plugins sind sofort nach Verbindung verfügbar
120
+
121
+ ### Plugin Manager
122
+ ```javascript
123
+ // Plugin laden
124
+ await client.pluginManager.load('economy-system');
125
+
126
+ // Alle Plugins laden
127
+ await client.pluginManager.loadAllPlugins();
128
+
129
+ // Plugin-Status
130
+ const stats = client.pluginManager.getStats();
131
+ console.log(`${stats.loaded}/${stats.available} Plugins geladen`);
132
+ ```
133
+
134
+ ### Storage Integration
135
+ Jedes Plugin nutzt das WAEngine Storage System:
136
+ ```javascript
137
+ // Plugin-spezifische Daten speichern
138
+ this.client.storage.write.in('economy').set(`${userId}.coins`, 1000);
139
+
140
+ // Daten lesen
141
+ const coins = this.client.storage.read.from('economy').get(`${userId}.coins`) || 0;
142
+ ```
143
+
144
+ ### Command System
145
+ Commands werden automatisch registriert:
146
+ ```javascript
147
+ getCommands() {
148
+ return {
149
+ 'balance': this.handleBalance.bind(this),
150
+ 'daily': this.handleDaily.bind(this)
151
+ };
152
+ }
153
+ ```
154
+
155
+ ## 📁 Plugin Struktur
156
+
157
+ ```
158
+ plugins/
159
+ ├── economy-system/
160
+ │ ├── index.js # Haupt-Plugin Klasse
161
+ │ └── config.json # Plugin-Konfiguration
162
+ ├── games-plugin/
163
+ │ ├── index.js
164
+ │ └── config.json
165
+ ├── music-plugin/
166
+ │ ├── index.js
167
+ │ └── config.json
168
+ ├── travel-plugin/
169
+ │ ├── index.js
170
+ │ └── config.json
171
+ ├── education-plugin/
172
+ │ ├── index.js
173
+ │ └── config.json
174
+ ├── moderation-plugin/
175
+ │ ├── index.js
176
+ │ └── config.json
177
+ ├── creative-plugin/
178
+ │ ├── index.js
179
+ │ └── config.json
180
+ └── analytics-plugin/
181
+ ├── index.js
182
+ └── config.json
183
+ ```
184
+
185
+ ## 🔧 Plugin Entwicklung
186
+
187
+ ### Plugin Klasse Template
188
+ ```javascript
189
+ export default class MyPlugin {
190
+ constructor(client) {
191
+ this.client = client;
192
+ this.name = 'my-plugin';
193
+ this.version = '1.0.0';
194
+ this.description = 'Mein erstes Plugin';
195
+ }
196
+
197
+ getCommands() {
198
+ return {
199
+ 'mycommand': this.handleMyCommand.bind(this)
200
+ };
201
+ }
202
+
203
+ async handleMyCommand(msg, args) {
204
+ await msg.reply('Hello from my plugin!');
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### Config.json Template
210
+ ```json
211
+ {
212
+ "name": "my-plugin",
213
+ "displayName": "My Plugin",
214
+ "version": "1.0.0",
215
+ "description": "Beschreibung des Plugins",
216
+ "author": "WAEngine",
217
+ "category": "utility",
218
+ "permissions": ["send_messages"],
219
+ "commands": [
220
+ {
221
+ "name": "mycommand",
222
+ "description": "Mein Command",
223
+ "usage": "!mycommand",
224
+ "adminOnly": false
225
+ }
226
+ ],
227
+ "dependencies": [],
228
+ "storage": ["my_data"]
229
+ }
230
+ ```
231
+
232
+ ## 🧪 Testing
233
+
234
+ Verwende die Test-Datei `plugin-system-test.js`:
235
+
236
+ ```bash
237
+ node plugin-system-test.js
238
+ ```
239
+
240
+ **Test Commands:**
241
+ - `!plugin-test` - Alle Plugin Commands anzeigen
242
+ - `!plugins` - Plugin Status
243
+ - `!test-economy` - Economy System testen
244
+ - `!test-games` - Games Plugin testen
245
+ - `!test-creative` - Creative Plugin testen
246
+ - `!test-analytics` - Analytics Plugin testen
247
+ - `!test-all` - Alle Plugins nacheinander testen
248
+
249
+ ## 📊 Plugin Statistiken
250
+
251
+ - **Gesamt Commands:** 80+ Commands
252
+ - **Storage Files:** Automatisch pro Plugin
253
+ - **Auto-Load:** Ja, nach WhatsApp Verbindung
254
+ - **Hot-Reload:** Nein (Neustart erforderlich)
255
+ - **Dependencies:** Automatisch verwaltet
256
+
257
+ ## 🔒 Sicherheit
258
+
259
+ - Plugins laufen in isolierten Kontexten
260
+ - Storage ist plugin-spezifisch getrennt
261
+ - Admin-Commands sind geschützt
262
+ - Auto-Moderation verhindert Missbrauch
263
+
264
+ ## 🚀 Verwendung
265
+
266
+ 1. **Bot starten:** `node plugin-system-test.js`
267
+ 2. **QR Code scannen:** Mit WhatsApp
268
+ 3. **Plugins werden automatisch geladen**
269
+ 4. **Commands verwenden:** `!plugin-test` für Übersicht
270
+
271
+ Alle 8 Plugins sind sofort nach der Verbindung verfügbar und bieten über 80 verschiedene Commands für jeden Anwendungsfall!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waengine",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "🚀 WAEngine - The most powerful WhatsApp Bot Library with Multi-Device Support & EasyBot API",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -27,6 +27,10 @@
27
27
  "prefix-system",
28
28
  "chat-specific",
29
29
  "group-management",
30
+ "plugin-system",
31
+ "optional-loading",
32
+ "modular",
33
+ "extensible",
30
34
  "typescript",
31
35
  "javascript",
32
36
  "nodejs"
@@ -55,16 +59,21 @@
55
59
  "pino": "^8.0.0",
56
60
  "playwright": "^1.58.1",
57
61
  "qrcode": "^1.5.4",
58
- "qrcode-terminal": "^0.12.0"
62
+ "qrcode-terminal": "^0.12.0",
63
+ "sharp": "^0.33.5"
59
64
  },
60
65
  "devDependencies": {
61
66
  "@types/node": "^20.0.0"
62
67
  },
63
68
  "files": [
64
69
  "src/",
70
+ "plugins/",
65
71
  "examples/",
66
72
  "README.md",
67
- "LICENSE"
73
+ "LICENSE",
74
+ "FEATURES.md",
75
+ "PLUGIN-SYSTEM.md",
76
+ "CHANGELOG.md"
68
77
  ],
69
78
  "funding": {
70
79
  "type": "github",
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "analytics-plugin",
3
+ "displayName": "Analytics Plugin",
4
+ "version": "1.0.0",
5
+ "description": "Detaillierte Statistiken und Analytics für Gruppen und User",
6
+ "author": "WAEngine",
7
+ "category": "analytics",
8
+ "permissions": [
9
+ "read_messages",
10
+ "track_activity",
11
+ "generate_reports"
12
+ ],
13
+ "commands": [
14
+ {
15
+ "name": "stats",
16
+ "description": "User-Statistiken anzeigen",
17
+ "usage": "!stats [@user]",
18
+ "adminOnly": false
19
+ },
20
+ {
21
+ "name": "mystats",
22
+ "description": "Eigene Statistiken anzeigen",
23
+ "usage": "!mystats",
24
+ "adminOnly": false
25
+ },
26
+ {
27
+ "name": "groupstats",
28
+ "description": "Gruppen-Statistiken anzeigen",
29
+ "usage": "!groupstats",
30
+ "adminOnly": false
31
+ },
32
+ {
33
+ "name": "globalstats",
34
+ "description": "Globale Statistiken anzeigen",
35
+ "usage": "!globalstats",
36
+ "adminOnly": false
37
+ },
38
+ {
39
+ "name": "topusers",
40
+ "description": "Top User anzeigen",
41
+ "usage": "!topusers [anzahl]",
42
+ "adminOnly": false
43
+ },
44
+ {
45
+ "name": "topgroups",
46
+ "description": "Top Gruppen anzeigen",
47
+ "usage": "!topgroups [anzahl]",
48
+ "adminOnly": false
49
+ },
50
+ {
51
+ "name": "topcommands",
52
+ "description": "Top Commands anzeigen",
53
+ "usage": "!topcommands [anzahl]",
54
+ "adminOnly": false
55
+ },
56
+ {
57
+ "name": "heatmap",
58
+ "description": "Aktivitäts-Heatmap anzeigen",
59
+ "usage": "!heatmap [me/group]",
60
+ "adminOnly": false
61
+ },
62
+ {
63
+ "name": "analytics",
64
+ "description": "Plugin-Übersicht",
65
+ "usage": "!analytics",
66
+ "adminOnly": false
67
+ },
68
+ {
69
+ "name": "export",
70
+ "description": "Persönliche Daten exportieren",
71
+ "usage": "!export",
72
+ "adminOnly": false
73
+ }
74
+ ],
75
+ "settings": {
76
+ "trackingEnabled": true,
77
+ "retentionDays": 365,
78
+ "anonymizeData": false,
79
+ "trackCommands": true,
80
+ "trackMedia": true,
81
+ "trackActivity": true
82
+ },
83
+ "dependencies": [],
84
+ "storage": [
85
+ "users",
86
+ "groups",
87
+ "global",
88
+ "commands",
89
+ "activity_logs"
90
+ ]
91
+ }