waengine 1.0.7 → 1.0.9
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.
- package/CHANGELOG.md +89 -0
- package/FEATURES.md +2354 -0
- package/PLUGIN-SYSTEM.md +271 -0
- package/package.json +14 -3
- package/plugins/analytics-plugin/config.json +91 -0
- package/plugins/analytics-plugin/index.js +461 -0
- package/plugins/creative-plugin/config.json +87 -0
- package/plugins/creative-plugin/index.js +320 -0
- package/plugins/economy-system/config.json +48 -0
- package/plugins/economy-system/index.js +237 -0
- package/plugins/education-plugin/index.js +275 -0
- package/plugins/games-plugin/config.json +35 -0
- package/plugins/games-plugin/index.js +300 -0
- package/plugins/moderation-plugin/config.json +86 -0
- package/plugins/moderation-plugin/index.js +458 -0
- package/plugins/music-plugin/config.json +32 -0
- package/plugins/music-plugin/index.js +221 -0
- package/plugins/travel-plugin/index.js +230 -0
- package/src/ai-integration.js +185 -0
- package/src/client.js +41 -0
- package/src/http-client.js +276 -0
- package/src/index.js +6 -0
- package/src/message.js +127 -1
- package/src/plugin-manager-fixed.js +116 -0
- package/src/plugin-manager.js +105 -0
- package/src/scheduler.js +322 -0
- package/src/sticker-creator.js +413 -0
- package/src/storage.js +422 -0
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
// 🛡️ Moderation Plugin
|
|
2
|
+
export default class ModerationPlugin {
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
this.name = 'moderation-plugin';
|
|
6
|
+
this.version = '1.0.0';
|
|
7
|
+
this.description = 'Erweiterte Moderation mit Auto-Mod, Spam-Schutz und Admin-Tools';
|
|
8
|
+
|
|
9
|
+
this.spamTracker = new Map();
|
|
10
|
+
this.autoModSettings = {
|
|
11
|
+
maxMessages: 5,
|
|
12
|
+
timeWindow: 10000, // 10 Sekunden
|
|
13
|
+
banWords: ['spam', 'werbung', 'fake', 'scam'],
|
|
14
|
+
maxCapsPercent: 70,
|
|
15
|
+
maxEmojis: 10
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
this.initAutoMod();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
initAutoMod() {
|
|
22
|
+
// Auto-Moderation bei jeder Nachricht
|
|
23
|
+
this.client.on('message', async (msg) => {
|
|
24
|
+
if (!msg.isGroup || msg.fromMe) return;
|
|
25
|
+
|
|
26
|
+
const groupId = msg.from;
|
|
27
|
+
const userId = msg.getSender();
|
|
28
|
+
|
|
29
|
+
// Prüfe Auto-Mod Einstellungen für Gruppe
|
|
30
|
+
const autoModEnabled = this.client.storage.read.from('moderation').get(`${groupId}.autoMod`) || false;
|
|
31
|
+
|
|
32
|
+
if (autoModEnabled && !msg.isAdmin()) {
|
|
33
|
+
await this.checkMessage(msg);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async checkMessage(msg) {
|
|
39
|
+
const groupId = msg.from;
|
|
40
|
+
const userId = msg.getSender();
|
|
41
|
+
const text = msg.text || '';
|
|
42
|
+
|
|
43
|
+
let violations = [];
|
|
44
|
+
|
|
45
|
+
// Spam-Check
|
|
46
|
+
if (this.isSpam(userId, text)) {
|
|
47
|
+
violations.push('Spam');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Banned Words Check
|
|
51
|
+
if (this.containsBannedWords(text)) {
|
|
52
|
+
violations.push('Verbotene Wörter');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Caps Check
|
|
56
|
+
if (this.isTooMuchCaps(text)) {
|
|
57
|
+
violations.push('Zu viele Großbuchstaben');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Emoji Check
|
|
61
|
+
if (this.tooManyEmojis(text)) {
|
|
62
|
+
violations.push('Zu viele Emojis');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (violations.length > 0) {
|
|
66
|
+
await this.handleViolation(msg, violations);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
isSpam(userId, text) {
|
|
71
|
+
const now = Date.now();
|
|
72
|
+
|
|
73
|
+
if (!this.spamTracker.has(userId)) {
|
|
74
|
+
this.spamTracker.set(userId, []);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const userMessages = this.spamTracker.get(userId);
|
|
78
|
+
|
|
79
|
+
// Alte Nachrichten entfernen
|
|
80
|
+
const filtered = userMessages.filter(time => now - time < this.autoModSettings.timeWindow);
|
|
81
|
+
|
|
82
|
+
filtered.push(now);
|
|
83
|
+
this.spamTracker.set(userId, filtered);
|
|
84
|
+
|
|
85
|
+
return filtered.length > this.autoModSettings.maxMessages;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
containsBannedWords(text) {
|
|
89
|
+
const lowerText = text.toLowerCase();
|
|
90
|
+
return this.autoModSettings.banWords.some(word => lowerText.includes(word));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
isTooMuchCaps(text) {
|
|
94
|
+
if (text.length < 10) return false;
|
|
95
|
+
|
|
96
|
+
const capsCount = (text.match(/[A-Z]/g) || []).length;
|
|
97
|
+
const capsPercent = (capsCount / text.length) * 100;
|
|
98
|
+
|
|
99
|
+
return capsPercent > this.autoModSettings.maxCapsPercent;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
tooManyEmojis(text) {
|
|
103
|
+
const emojiRegex = /[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu;
|
|
104
|
+
const emojis = text.match(emojiRegex) || [];
|
|
105
|
+
|
|
106
|
+
return emojis.length > this.autoModSettings.maxEmojis;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async handleViolation(msg, violations) {
|
|
110
|
+
const groupId = msg.from;
|
|
111
|
+
const userId = msg.getSender();
|
|
112
|
+
|
|
113
|
+
// Warnung hinzufügen
|
|
114
|
+
this.client.storage.write.in('moderation').increment(`${groupId}.warnings.${userId}`, 1);
|
|
115
|
+
const warnings = this.client.storage.read.from('moderation').get(`${groupId}.warnings.${userId}`) || 0;
|
|
116
|
+
|
|
117
|
+
// Nachricht löschen
|
|
118
|
+
try {
|
|
119
|
+
await msg.delete();
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.log('⚠️ Konnte Nachricht nicht löschen');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Warnung senden
|
|
125
|
+
let warnText = `⚠️ **Auto-Moderation**\n\n`;
|
|
126
|
+
warnText += `👤 User: @${userId.split('@')[0]}\n`;
|
|
127
|
+
warnText += `📋 Verstöße: ${violations.join(', ')}\n`;
|
|
128
|
+
warnText += `⚠️ Warnungen: ${warnings}/3\n\n`;
|
|
129
|
+
|
|
130
|
+
if (warnings >= 3) {
|
|
131
|
+
warnText += `🚫 **Automatischer Kick nach 3 Warnungen!**`;
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
await this.client.removeParticipant(groupId, userId);
|
|
135
|
+
} catch (error) {
|
|
136
|
+
warnText += `\n❌ Kick fehlgeschlagen - Keine Admin-Rechte`;
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
warnText += `💡 Bitte beachte die Gruppenregeln!`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
await msg.reply(warnText, [userId]);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async getUserWarnings(groupId, userId) {
|
|
146
|
+
return this.client.storage.read.from('moderation').get(`${groupId}.warnings.${userId}`) || 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async clearWarnings(groupId, userId) {
|
|
150
|
+
this.client.storage.delete.from('moderation').key(`${groupId}.warnings.${userId}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async getModerationStats(groupId) {
|
|
154
|
+
const warnings = this.client.storage.read.from('moderation').get(`${groupId}.warnings`) || {};
|
|
155
|
+
const autoMod = this.client.storage.read.from('moderation').get(`${groupId}.autoMod`) || false;
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
totalWarnings: Object.values(warnings).reduce((sum, count) => sum + count, 0),
|
|
159
|
+
usersWithWarnings: Object.keys(warnings).length,
|
|
160
|
+
autoModEnabled: autoMod,
|
|
161
|
+
topOffenders: Object.entries(warnings)
|
|
162
|
+
.sort(([,a], [,b]) => b - a)
|
|
163
|
+
.slice(0, 5)
|
|
164
|
+
.map(([user, count]) => ({ user, warnings: count }))
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
getCommands() {
|
|
169
|
+
return {
|
|
170
|
+
'warn': this.handleWarn.bind(this),
|
|
171
|
+
'unwarn': this.handleUnwarn.bind(this),
|
|
172
|
+
'warnings': this.handleWarnings.bind(this),
|
|
173
|
+
'kick': this.handleKick.bind(this),
|
|
174
|
+
'ban': this.handleBan.bind(this),
|
|
175
|
+
'unban': this.handleUnban.bind(this),
|
|
176
|
+
'mute': this.handleMute.bind(this),
|
|
177
|
+
'unmute': this.handleUnmute.bind(this),
|
|
178
|
+
'automod': this.handleAutoMod.bind(this),
|
|
179
|
+
'modstats': this.handleModStats.bind(this),
|
|
180
|
+
'rules': this.handleRules.bind(this),
|
|
181
|
+
'setrules': this.handleSetRules.bind(this),
|
|
182
|
+
'purge': this.handlePurge.bind(this)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async handleWarn(msg, args) {
|
|
187
|
+
if (!msg.isGroup || !msg.isAdmin()) {
|
|
188
|
+
return msg.reply('❌ Nur Admins können Warnungen vergeben!');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (args.length === 0) {
|
|
192
|
+
return msg.reply('❌ Verwendung: !warn @user [grund]\n\n⚠️ Beispiel: !warn @user Spam');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const mentionedUsers = msg.getMentionedUsers();
|
|
196
|
+
if (mentionedUsers.length === 0) {
|
|
197
|
+
return msg.reply('❌ Bitte erwähne einen User zum Warnen!');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const targetUser = mentionedUsers[0];
|
|
201
|
+
const reason = args.slice(1).join(' ') || 'Kein Grund angegeben';
|
|
202
|
+
const groupId = msg.from;
|
|
203
|
+
|
|
204
|
+
// Warnung hinzufügen
|
|
205
|
+
this.client.storage.write.in('moderation').increment(`${groupId}.warnings.${targetUser}`, 1);
|
|
206
|
+
const warnings = this.client.storage.read.from('moderation').get(`${groupId}.warnings.${targetUser}`) || 0;
|
|
207
|
+
|
|
208
|
+
let warnText = `⚠️ **Warnung vergeben**\n\n`;
|
|
209
|
+
warnText += `👤 User: @${targetUser.split('@')[0]}\n`;
|
|
210
|
+
warnText += `📝 Grund: ${reason}\n`;
|
|
211
|
+
warnText += `⚠️ Warnungen: ${warnings}/3\n`;
|
|
212
|
+
warnText += `👮 Admin: @${msg.getSender().split('@')[0]}`;
|
|
213
|
+
|
|
214
|
+
if (warnings >= 3) {
|
|
215
|
+
warnText += `\n\n🚫 **3 Warnungen erreicht - Automatischer Kick!**`;
|
|
216
|
+
|
|
217
|
+
try {
|
|
218
|
+
await this.client.removeParticipant(groupId, targetUser);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
warnText += `\n❌ Kick fehlgeschlagen`;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
await msg.reply(warnText, [targetUser, msg.getSender()]);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async handleUnwarn(msg, args) {
|
|
228
|
+
if (!msg.isGroup || !msg.isAdmin()) {
|
|
229
|
+
return msg.reply('❌ Nur Admins können Warnungen entfernen!');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const mentionedUsers = msg.getMentionedUsers();
|
|
233
|
+
if (mentionedUsers.length === 0) {
|
|
234
|
+
return msg.reply('❌ Bitte erwähne einen User!');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const targetUser = mentionedUsers[0];
|
|
238
|
+
const groupId = msg.from;
|
|
239
|
+
|
|
240
|
+
const currentWarnings = this.client.storage.read.from('moderation').get(`${groupId}.warnings.${targetUser}`) || 0;
|
|
241
|
+
|
|
242
|
+
if (currentWarnings === 0) {
|
|
243
|
+
return msg.reply('❌ User hat keine Warnungen!');
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
this.client.storage.write.in('moderation').increment(`${groupId}.warnings.${targetUser}`, -1);
|
|
247
|
+
const newWarnings = this.client.storage.read.from('moderation').get(`${groupId}.warnings.${targetUser}`) || 0;
|
|
248
|
+
|
|
249
|
+
let unwarnText = `✅ **Warnung entfernt**\n\n`;
|
|
250
|
+
unwarnText += `👤 User: @${targetUser.split('@')[0]}\n`;
|
|
251
|
+
unwarnText += `⚠️ Warnungen: ${newWarnings}/3\n`;
|
|
252
|
+
unwarnText += `👮 Admin: @${msg.getSender().split('@')[0]}`;
|
|
253
|
+
|
|
254
|
+
await msg.reply(unwarnText, [targetUser, msg.getSender()]);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async handleWarnings(msg, args) {
|
|
258
|
+
if (!msg.isGroup) {
|
|
259
|
+
return msg.reply('❌ Nur in Gruppen verfügbar!');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const groupId = msg.from;
|
|
263
|
+
const mentionedUsers = msg.getMentionedUsers();
|
|
264
|
+
|
|
265
|
+
if (mentionedUsers.length > 0) {
|
|
266
|
+
// Warnungen für spezifischen User
|
|
267
|
+
const targetUser = mentionedUsers[0];
|
|
268
|
+
const warnings = await this.getUserWarnings(groupId, targetUser);
|
|
269
|
+
|
|
270
|
+
let warningsText = `⚠️ **Warnungen für @${targetUser.split('@')[0]}**\n\n`;
|
|
271
|
+
warningsText += `📊 Aktuelle Warnungen: ${warnings}/3`;
|
|
272
|
+
|
|
273
|
+
await msg.reply(warningsText, [targetUser]);
|
|
274
|
+
} else {
|
|
275
|
+
// Alle Warnungen in der Gruppe
|
|
276
|
+
const allWarnings = this.client.storage.read.from('moderation').get(`${groupId}.warnings`) || {};
|
|
277
|
+
|
|
278
|
+
if (Object.keys(allWarnings).length === 0) {
|
|
279
|
+
return msg.reply('✅ Keine Warnungen in dieser Gruppe!');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
let warningsText = `⚠️ **Gruppen-Warnungen**\n\n`;
|
|
283
|
+
|
|
284
|
+
Object.entries(allWarnings)
|
|
285
|
+
.sort(([,a], [,b]) => b - a)
|
|
286
|
+
.slice(0, 10)
|
|
287
|
+
.forEach(([user, count]) => {
|
|
288
|
+
warningsText += `• @${user.split('@')[0]}: ${count}/3\n`;
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
await msg.reply(warningsText);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
async handleKick(msg, args) {
|
|
296
|
+
if (!msg.isGroup || !msg.isAdmin()) {
|
|
297
|
+
return msg.reply('❌ Nur Admins können User kicken!');
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const mentionedUsers = msg.getMentionedUsers();
|
|
301
|
+
if (mentionedUsers.length === 0) {
|
|
302
|
+
return msg.reply('❌ Bitte erwähne einen User zum Kicken!');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const targetUser = mentionedUsers[0];
|
|
306
|
+
const reason = args.slice(1).join(' ') || 'Kein Grund angegeben';
|
|
307
|
+
const groupId = msg.from;
|
|
308
|
+
|
|
309
|
+
try {
|
|
310
|
+
await this.client.removeParticipant(groupId, targetUser);
|
|
311
|
+
|
|
312
|
+
let kickText = `🚫 **User gekickt**\n\n`;
|
|
313
|
+
kickText += `👤 User: @${targetUser.split('@')[0]}\n`;
|
|
314
|
+
kickText += `📝 Grund: ${reason}\n`;
|
|
315
|
+
kickText += `👮 Admin: @${msg.getSender().split('@')[0]}`;
|
|
316
|
+
|
|
317
|
+
await msg.reply(kickText, [msg.getSender()]);
|
|
318
|
+
} catch (error) {
|
|
319
|
+
await msg.reply('❌ Kick fehlgeschlagen - Keine Admin-Rechte oder User nicht gefunden!');
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
async handleAutoMod(msg, args) {
|
|
324
|
+
if (!msg.isGroup || !msg.isAdmin()) {
|
|
325
|
+
return msg.reply('❌ Nur Admins können Auto-Moderation verwalten!');
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const groupId = msg.from;
|
|
329
|
+
|
|
330
|
+
if (args.length === 0) {
|
|
331
|
+
const autoMod = this.client.storage.read.from('moderation').get(`${groupId}.autoMod`) || false;
|
|
332
|
+
|
|
333
|
+
let autoModText = `🤖 **Auto-Moderation Status**\n\n`;
|
|
334
|
+
autoModText += `📊 Status: ${autoMod ? '✅ Aktiviert' : '❌ Deaktiviert'}\n\n`;
|
|
335
|
+
autoModText += `⚙️ **Einstellungen:**\n`;
|
|
336
|
+
autoModText += `• Max Nachrichten: ${this.autoModSettings.maxMessages} in ${this.autoModSettings.timeWindow/1000}s\n`;
|
|
337
|
+
autoModText += `• Verbotene Wörter: ${this.autoModSettings.banWords.length}\n`;
|
|
338
|
+
autoModText += `• Max Großbuchstaben: ${this.autoModSettings.maxCapsPercent}%\n`;
|
|
339
|
+
autoModText += `• Max Emojis: ${this.autoModSettings.maxEmojis}\n\n`;
|
|
340
|
+
autoModText += `💡 Verwende: !automod on/off`;
|
|
341
|
+
|
|
342
|
+
return msg.reply(autoModText);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const action = args[0].toLowerCase();
|
|
346
|
+
|
|
347
|
+
if (action === 'on') {
|
|
348
|
+
this.client.storage.write.in('moderation').set(`${groupId}.autoMod`, true);
|
|
349
|
+
await msg.reply('✅ **Auto-Moderation aktiviert!**\n\n🤖 Spam, verbotene Wörter und andere Verstöße werden automatisch erkannt.');
|
|
350
|
+
} else if (action === 'off') {
|
|
351
|
+
this.client.storage.write.in('moderation').set(`${groupId}.autoMod`, false);
|
|
352
|
+
await msg.reply('❌ **Auto-Moderation deaktiviert!**\n\n⚠️ Manuelle Moderation erforderlich.');
|
|
353
|
+
} else {
|
|
354
|
+
await msg.reply('❌ Verwendung: !automod on/off');
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
async handleModStats(msg, args) {
|
|
359
|
+
if (!msg.isGroup) {
|
|
360
|
+
return msg.reply('❌ Nur in Gruppen verfügbar!');
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const groupId = msg.from;
|
|
364
|
+
const stats = await this.getModerationStats(groupId);
|
|
365
|
+
|
|
366
|
+
let statsText = `📊 **Moderations-Statistiken**\n\n`;
|
|
367
|
+
statsText += `⚠️ Gesamte Warnungen: ${stats.totalWarnings}\n`;
|
|
368
|
+
statsText += `👥 User mit Warnungen: ${stats.usersWithWarnings}\n`;
|
|
369
|
+
statsText += `🤖 Auto-Mod: ${stats.autoModEnabled ? '✅ An' : '❌ Aus'}\n\n`;
|
|
370
|
+
|
|
371
|
+
if (stats.topOffenders.length > 0) {
|
|
372
|
+
statsText += `🏆 **Top Regelbrecher:**\n`;
|
|
373
|
+
stats.topOffenders.forEach((offender, index) => {
|
|
374
|
+
statsText += `${index + 1}. @${offender.user.split('@')[0]}: ${offender.warnings} Warnungen\n`;
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
await msg.reply(statsText);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
async handleRules(msg, args) {
|
|
382
|
+
if (!msg.isGroup) {
|
|
383
|
+
return msg.reply('❌ Nur in Gruppen verfügbar!');
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const groupId = msg.from;
|
|
387
|
+
const rules = this.client.storage.read.from('moderation').get(`${groupId}.rules`) || [];
|
|
388
|
+
|
|
389
|
+
if (rules.length === 0) {
|
|
390
|
+
return msg.reply('📋 **Keine Regeln festgelegt!**\n\n💡 Admins können mit !setrules Regeln hinzufügen.');
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
let rulesText = `📋 **Gruppenregeln:**\n\n`;
|
|
394
|
+
rules.forEach((rule, index) => {
|
|
395
|
+
rulesText += `${index + 1}. ${rule}\n`;
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
await msg.reply(rulesText);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
async handleSetRules(msg, args) {
|
|
402
|
+
if (!msg.isGroup || !msg.isAdmin()) {
|
|
403
|
+
return msg.reply('❌ Nur Admins können Regeln festlegen!');
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (args.length === 0) {
|
|
407
|
+
return msg.reply('❌ Verwendung: !setrules <regel1> | <regel2> | <regel3>\n\n📝 Beispiel: !setrules Kein Spam | Respektvoller Umgang | Keine Werbung');
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const groupId = msg.from;
|
|
411
|
+
const rulesText = args.join(' ');
|
|
412
|
+
const rules = rulesText.split('|').map(rule => rule.trim()).filter(rule => rule.length > 0);
|
|
413
|
+
|
|
414
|
+
this.client.storage.write.in('moderation').set(`${groupId}.rules`, rules);
|
|
415
|
+
|
|
416
|
+
let confirmText = `✅ **Regeln aktualisiert!**\n\n📋 **Neue Regeln:**\n`;
|
|
417
|
+
rules.forEach((rule, index) => {
|
|
418
|
+
confirmText += `${index + 1}. ${rule}\n`;
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
await msg.reply(confirmText);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
async handlePurge(msg, args) {
|
|
425
|
+
if (!msg.isGroup || !msg.isAdmin()) {
|
|
426
|
+
return msg.reply('❌ Nur Admins können Nachrichten löschen!');
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (args.length === 0) {
|
|
430
|
+
return msg.reply('❌ Verwendung: !purge <anzahl>\n\n🗑️ Beispiel: !purge 10');
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
const amount = parseInt(args[0]);
|
|
434
|
+
|
|
435
|
+
if (isNaN(amount) || amount < 1 || amount > 100) {
|
|
436
|
+
return msg.reply('❌ Anzahl muss zwischen 1 und 100 liegen!');
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
await msg.reply(`🗑️ **Purge-Befehl erhalten**\n\n⚠️ Lösche ${amount} Nachrichten...\n💡 Diese Funktion ist experimentell.`);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// Weitere Moderation-Methoden können hier hinzugefügt werden
|
|
443
|
+
async handleBan(msg, args) {
|
|
444
|
+
await msg.reply('🚫 **Ban-System**\n\n⚠️ Diese Funktion ist in Entwicklung.\n💡 Verwende !kick für sofortiges Entfernen.');
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
async handleUnban(msg, args) {
|
|
448
|
+
await msg.reply('✅ **Unban-System**\n\n⚠️ Diese Funktion ist in Entwicklung.');
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
async handleMute(msg, args) {
|
|
452
|
+
await msg.reply('🔇 **Mute-System**\n\n⚠️ Diese Funktion ist in Entwicklung.\n💡 WhatsApp unterstützt kein direktes Muting.');
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
async handleUnmute(msg, args) {
|
|
456
|
+
await msg.reply('🔊 **Unmute-System**\n\n⚠️ Diese Funktion ist in Entwicklung.');
|
|
457
|
+
}
|
|
458
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Music Plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Music System mit YouTube Download und Spotify Integration",
|
|
5
|
+
"author": "WAEngine",
|
|
6
|
+
"commands": [
|
|
7
|
+
"music",
|
|
8
|
+
"youtube",
|
|
9
|
+
"download",
|
|
10
|
+
"playlist",
|
|
11
|
+
"lyrics",
|
|
12
|
+
"spotify"
|
|
13
|
+
],
|
|
14
|
+
"permissions": {
|
|
15
|
+
"music": "all",
|
|
16
|
+
"youtube": "all",
|
|
17
|
+
"download": "all",
|
|
18
|
+
"playlist": "all",
|
|
19
|
+
"lyrics": "all",
|
|
20
|
+
"spotify": "all"
|
|
21
|
+
},
|
|
22
|
+
"settings": {
|
|
23
|
+
"maxSearchResults": 5,
|
|
24
|
+
"audioQuality": "best",
|
|
25
|
+
"downloadPath": "./downloads/",
|
|
26
|
+
"maxPlaylistSize": 100
|
|
27
|
+
},
|
|
28
|
+
"requirements": {
|
|
29
|
+
"ytdlp": "pip install yt-dlp",
|
|
30
|
+
"ffmpeg": "Required for audio conversion"
|
|
31
|
+
}
|
|
32
|
+
}
|