levix-bot 4.2.1 → 4.3.1
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/app.cjs +50 -4
- package/package.json +1 -1
- package/public/dashboard/assets/index-B6RhYFIy.js +446 -0
- package/public/dashboard/assets/index-vEwOcxiH.css +2 -0
- package/public/dashboard/index.html +2 -2
- package/public/dashboard.css +71 -1
- package/public/gateway.js +41 -0
- package/src/bootstrap/core.js +4 -0
- package/src/bootstrap/panel.js +2 -0
- package/src/commands/autoschedule.cjs +11 -14
- package/src/commands/blacklist.cjs +1 -1
- package/src/commands/block.cjs +1 -1
- package/src/commands/calc.cjs +9 -9
- package/src/commands/gemini.cjs +26 -26
- package/src/commands/group/add.cjs +2 -2
- package/src/commands/group/demote.cjs +2 -2
- package/src/commands/group/members.cjs +2 -2
- package/src/commands/group/rules.cjs +1 -1
- package/src/commands/group/setname.cjs +3 -3
- package/src/commands/group/setpp.cjs +3 -3
- package/src/commands/group/setrules.cjs +1 -1
- package/src/commands/group/tagadmins.cjs +1 -1
- package/src/commands/group.cjs +1 -1
- package/src/commands/lang.cjs +3 -3
- package/src/commands/listschedules.cjs +1 -1
- package/src/commands/loop.cjs +3 -3
- package/src/commands/memory.cjs +18 -18
- package/src/commands/notes.cjs +1 -1
- package/src/commands/perm.cjs +2 -2
- package/src/commands/poll.cjs +3 -3
- package/src/commands/rand.cjs +2 -2
- package/src/commands/restart.cjs +46 -17
- package/src/commands/schedule.cjs +9 -11
- package/src/commands/send.cjs +116 -0
- package/src/commands/status.cjs +2 -2
- package/src/commands/stopbot.cjs +68 -0
- package/src/commands/stt.cjs +1 -1
- package/src/commands/tts.cjs +2 -2
- package/src/commands/unblock.cjs +1 -1
- package/src/config/defaults.cjs +2 -1
- package/src/config/settings.cjs +4 -2
- package/src/core/session-holder.cjs +23 -0
- package/src/handlers/command.handler.js +4 -6
- package/src/panel/password-reset.cjs +187 -0
- package/src/routes/dashboard.api.esm.js +48 -78
- package/src/services/aiAgent.cjs +2 -2
- package/src/services/aiProviders.cjs +1 -1
- package/src/services/aiTools.cjs +27 -27
- package/src/services/settingsTransfer.cjs +246 -0
- package/src/utils/memory.cjs +7 -7
- package/views/login.ejs +209 -9
- package/views/setup.ejs +19 -5
- package/public/dashboard/assets/index-4AuqfnH5.js +0 -431
- package/public/dashboard/assets/index-LvfJ8ybs.css +0 -2
- package/src/commands/shutdown.cjs +0 -55
package/src/commands/gemini.cjs
CHANGED
|
@@ -243,7 +243,7 @@ function summarizeEntry(e, idx) {
|
|
|
243
243
|
bits.push(
|
|
244
244
|
tr(
|
|
245
245
|
`🖼️↩️ quoted media (${e.quotedMediaParts.length})`,
|
|
246
|
-
`🖼️↩️
|
|
246
|
+
`🖼️↩️ وسائط مقتبسة (${e.quotedMediaParts.length})`,
|
|
247
247
|
),
|
|
248
248
|
);
|
|
249
249
|
}
|
|
@@ -259,7 +259,7 @@ module.exports = {
|
|
|
259
259
|
},
|
|
260
260
|
usage: {
|
|
261
261
|
en: "gemini <text>\ngemini add <text>\ngemini send\ngemini show\ngemini clear\ngenerate <image description>\ndel (clear this chat's conversation)\ndelall (clear every conversation)",
|
|
262
|
-
ar: "gemini <النص>\ngemini add <النص>\ngemini send\ngemini show\ngemini clear\ngenerate <وصف الصورة>\ndel (مسح سجل
|
|
262
|
+
ar: "gemini <النص>\ngemini add <النص>\ngemini send\ngemini show\ngemini clear\ngenerate <وصف الصورة>\ndel (مسح سجل هذه المحادثة)\ndelall (مسح كل المحادثات)",
|
|
263
263
|
},
|
|
264
264
|
chat: "all",
|
|
265
265
|
|
|
@@ -310,7 +310,7 @@ module.exports = {
|
|
|
310
310
|
"✅ Conversation history cleared.\n" +
|
|
311
311
|
"_(Long-term memory isn't cleared this way — use `!memory clear` if that's what you meant.)_",
|
|
312
312
|
"✅ تم مسح سجل المحادثة.\n" +
|
|
313
|
-
"_(الذاكرة الدائمة
|
|
313
|
+
"_(لا تُحذف الذاكرة الدائمة بهذه الطريقة. استخدم `!memory clear` إذا أردت حذفها.)_",
|
|
314
314
|
),
|
|
315
315
|
},
|
|
316
316
|
{ replyTo: msg },
|
|
@@ -350,7 +350,7 @@ module.exports = {
|
|
|
350
350
|
{
|
|
351
351
|
text: tr(
|
|
352
352
|
"Describe the image you want after the command. Example: !generate a cat wearing a hat",
|
|
353
|
-
"اكتب
|
|
353
|
+
"اكتب وصفًا للصورة التي تريدها بعد الأمر. مثال: !generate قطة ترتدي قبعة",
|
|
354
354
|
),
|
|
355
355
|
},
|
|
356
356
|
{ replyTo: msg },
|
|
@@ -360,7 +360,7 @@ module.exports = {
|
|
|
360
360
|
const status = await createStatus(
|
|
361
361
|
sock,
|
|
362
362
|
chatId,
|
|
363
|
-
tr("🎨 Making the image...", "🎨
|
|
363
|
+
tr("🎨 Making the image...", "🎨 جارٍ إنشاء الصورة..."),
|
|
364
364
|
{ replyTo: msg },
|
|
365
365
|
);
|
|
366
366
|
|
|
@@ -372,7 +372,7 @@ module.exports = {
|
|
|
372
372
|
throw new Error(
|
|
373
373
|
tr(
|
|
374
374
|
"No Gemini API key is set — image generation only runs on Gemini",
|
|
375
|
-
"مفتاح Gemini API
|
|
375
|
+
"لم يُضبط مفتاح Gemini API — توليد الصور يعمل على Gemini فقط",
|
|
376
376
|
),
|
|
377
377
|
);
|
|
378
378
|
}
|
|
@@ -397,7 +397,7 @@ module.exports = {
|
|
|
397
397
|
(part) => part?.inlineData?.data,
|
|
398
398
|
);
|
|
399
399
|
if (!image) {
|
|
400
|
-
throw new Error(tr("The model answered without an image", "
|
|
400
|
+
throw new Error(tr("The model answered without an image", "أعاد النموذج ردًا دون صورة"));
|
|
401
401
|
}
|
|
402
402
|
const imageBuffer = Buffer.from(image.inlineData.data, "base64");
|
|
403
403
|
|
|
@@ -413,7 +413,7 @@ module.exports = {
|
|
|
413
413
|
);
|
|
414
414
|
} catch (error) {
|
|
415
415
|
logger.error({ err: error }, `Error in !generate command`);
|
|
416
|
-
await status.fail(error, tr("I couldn't make the image", "
|
|
416
|
+
await status.fail(error, tr("I couldn't make the image", "تعذّر إنشاء الصورة"));
|
|
417
417
|
}
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
@@ -429,8 +429,8 @@ module.exports = {
|
|
|
429
429
|
text: tr(
|
|
430
430
|
"📭 Nothing to add to the context.\n\n" +
|
|
431
431
|
"Write text after the command, reply to a message, or send media with the caption `!gemini add`.",
|
|
432
|
-
"📭
|
|
433
|
-
"اكتب
|
|
432
|
+
"📭 لا يوجد محتوى لإضافته إلى السياق.\n\n" +
|
|
433
|
+
"اكتب نصًا بعد الأمر، أو ردّ على رسالة، أو أرسل ملف وسائط مع الوصف `!gemini add`.",
|
|
434
434
|
),
|
|
435
435
|
},
|
|
436
436
|
{ replyTo: msg },
|
|
@@ -444,7 +444,7 @@ module.exports = {
|
|
|
444
444
|
{
|
|
445
445
|
text: tr(
|
|
446
446
|
`The context is full (${MAX_BUFFER_ENTRIES} messages at most). Send \`!gemini send\` or \`!gemini clear\`.`,
|
|
447
|
-
|
|
447
|
+
`السياق ممتلئ (حد أقصى ${MAX_BUFFER_ENTRIES} رسائل). أرسل \`!gemini send\` أو \`!gemini clear\`.`,
|
|
448
448
|
),
|
|
449
449
|
},
|
|
450
450
|
{ replyTo: msg },
|
|
@@ -459,8 +459,8 @@ module.exports = {
|
|
|
459
459
|
text: tr(
|
|
460
460
|
"The context is too big, or too many contexts are open. " +
|
|
461
461
|
"Send `!gemini send` or `!gemini clear` and try again.",
|
|
462
|
-
"
|
|
463
|
-
"
|
|
462
|
+
"السياق كبير جدًا، أو بلغ عدد السياقات المفتوحة الحد الأقصى. " +
|
|
463
|
+
"أرسل `!gemini send` أو `!gemini clear` وحاول مرة أخرى.",
|
|
464
464
|
),
|
|
465
465
|
},
|
|
466
466
|
{ replyTo: msg },
|
|
@@ -474,8 +474,8 @@ module.exports = {
|
|
|
474
474
|
text: tr(
|
|
475
475
|
`✅ Added to the context. (Total now: *${stored.length}*)\n\n` +
|
|
476
476
|
"Keep going with `!gemini add ...`, or send it all with `!gemini send`.",
|
|
477
|
-
`✅
|
|
478
|
-
"
|
|
477
|
+
`✅ أُضيفت إلى السياق. (إجمالي الآن: *${stored.length}*)\n\n` +
|
|
478
|
+
"تابع باستخدام `!gemini add ...`، أو أرسل المحتوى كله باستخدام `!gemini send`.",
|
|
479
479
|
),
|
|
480
480
|
},
|
|
481
481
|
{ replyTo: msg },
|
|
@@ -492,9 +492,9 @@ module.exports = {
|
|
|
492
492
|
text: had
|
|
493
493
|
? tr(
|
|
494
494
|
`🗑️ Cleared *${had}* messages from the context.`,
|
|
495
|
-
`🗑️ تم مسح *${had}* رسالة من
|
|
495
|
+
`🗑️ تم مسح *${had}* رسالة من السياق.`,
|
|
496
496
|
)
|
|
497
|
-
: tr("📭 The context was already empty.", "📭
|
|
497
|
+
: tr("📭 The context was already empty.", "📭 السياق فارغ بالفعل."),
|
|
498
498
|
},
|
|
499
499
|
{ replyTo: msg },
|
|
500
500
|
);
|
|
@@ -509,7 +509,7 @@ module.exports = {
|
|
|
509
509
|
{
|
|
510
510
|
text: tr(
|
|
511
511
|
"📭 The context is empty. Start with `!gemini add ...`.",
|
|
512
|
-
"📭
|
|
512
|
+
"📭 السياق فارغ. ابدأ بـ `!gemini add ...`.",
|
|
513
513
|
),
|
|
514
514
|
},
|
|
515
515
|
{ replyTo: msg },
|
|
@@ -522,12 +522,12 @@ module.exports = {
|
|
|
522
522
|
text:
|
|
523
523
|
tr(
|
|
524
524
|
`📋 *Current context:* (${buf.length} messages)\n\n`,
|
|
525
|
-
`📋
|
|
525
|
+
`📋 *السياق الحالي:* (${buf.length} رسالة)\n\n`,
|
|
526
526
|
) +
|
|
527
527
|
buf.map((e, i) => summarizeEntry(e, i)).join("\n") +
|
|
528
528
|
tr(
|
|
529
529
|
"\n\nSend it all with `!gemini send` or clear it with `!gemini clear`.",
|
|
530
|
-
"\n\n
|
|
530
|
+
"\n\nأرسل المحتوى كله باستخدام `!gemini send` أو امسحه باستخدام `!gemini clear`.",
|
|
531
531
|
),
|
|
532
532
|
},
|
|
533
533
|
{ replyTo: msg },
|
|
@@ -551,8 +551,8 @@ module.exports = {
|
|
|
551
551
|
text: tr(
|
|
552
552
|
"📭 The context is empty and `!gemini send` has no text.\n\n" +
|
|
553
553
|
"Start with `!gemini add ...`, or write text with `!gemini send ...`.",
|
|
554
|
-
"📭
|
|
555
|
-
"ابدأ بـ `!gemini add ...`
|
|
554
|
+
"📭 السياق فارغ ولا يوجد نص في `!gemini send`.\n\n" +
|
|
555
|
+
"ابدأ بـ `!gemini add ...` أولًا، أو اكتب نصًا مع `!gemini send ...`.",
|
|
556
556
|
),
|
|
557
557
|
},
|
|
558
558
|
{ replyTo: msg },
|
|
@@ -671,7 +671,7 @@ module.exports = {
|
|
|
671
671
|
sock,
|
|
672
672
|
chatId,
|
|
673
673
|
mediaError,
|
|
674
|
-
tr("There was a problem with the quoted message", "
|
|
674
|
+
tr("There was a problem with the quoted message", "حدثت مشكلة في الرسالة المقتبسة"),
|
|
675
675
|
{
|
|
676
676
|
replyTo: msg,
|
|
677
677
|
},
|
|
@@ -708,7 +708,7 @@ module.exports = {
|
|
|
708
708
|
{
|
|
709
709
|
text: tr(
|
|
710
710
|
`Settings problem: no API key is set for the current AI provider (${activeProvider.label || activeProvider.id}) — set it in the control panel.`,
|
|
711
|
-
`خطأ في الإعدادات: مفتاح
|
|
711
|
+
`خطأ في الإعدادات: لم يُضبط مفتاح مزوّد الذكاء الاصطناعي الحالي (${activeProvider.label || activeProvider.id}) — اضبطه من لوحة التحكم.`,
|
|
712
712
|
),
|
|
713
713
|
},
|
|
714
714
|
{ replyTo: msg },
|
|
@@ -749,7 +749,7 @@ module.exports = {
|
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
// The one message that will carry the whole run.
|
|
752
|
-
const status = await createStatus(sock, chatId, tr("🤖 Thinking...", "🤖
|
|
752
|
+
const status = await createStatus(sock, chatId, tr("🤖 Thinking...", "🤖 جارٍ التفكير..."), {
|
|
753
753
|
replyTo: msg,
|
|
754
754
|
});
|
|
755
755
|
|
|
@@ -789,7 +789,7 @@ module.exports = {
|
|
|
789
789
|
result.text?.trim() ||
|
|
790
790
|
tr(
|
|
791
791
|
"The model sent no answer. Try asking another way.",
|
|
792
|
-
"
|
|
792
|
+
"لم يردّ النموذج. حاول صياغة السؤال بطريقة أخرى.",
|
|
793
793
|
);
|
|
794
794
|
// Appended only when Gemini really grounded the answer on a search —
|
|
795
795
|
// formatSources() returns "" for an answer the model gave from its own
|
|
@@ -84,7 +84,7 @@ module.exports = {
|
|
|
84
84
|
return await sock.sendMessage(groupId, {
|
|
85
85
|
text: tr(
|
|
86
86
|
`⚠️ @${targetJid.split("@")[0]} is already in the group.`,
|
|
87
|
-
`⚠️ العضو @${targetJid.split("@")[0]} موجود بالفعل في
|
|
87
|
+
`⚠️ العضو @${targetJid.split("@")[0]} موجود بالفعل في المجموعة.`,
|
|
88
88
|
),
|
|
89
89
|
mentions: [targetJid],
|
|
90
90
|
});
|
|
@@ -93,7 +93,7 @@ module.exports = {
|
|
|
93
93
|
await sock.sendMessage(groupId, {
|
|
94
94
|
text: tr(
|
|
95
95
|
`Trying to add @${targetJid.split("@")[0]}...`,
|
|
96
|
-
|
|
96
|
+
`جارٍ محاولة إضافة @${targetJid.split("@")[0]}...`,
|
|
97
97
|
),
|
|
98
98
|
mentions: [targetJid],
|
|
99
99
|
});
|
|
@@ -39,7 +39,7 @@ module.exports = {
|
|
|
39
39
|
return await sock.sendMessage(groupId, {
|
|
40
40
|
text: tr(
|
|
41
41
|
`⚠️ @${targetJid.split("@")[0]} isn't an admin.`,
|
|
42
|
-
`⚠️ العضو @${targetJid.split("@")[0]} ليس مشرفًا
|
|
42
|
+
`⚠️ العضو @${targetJid.split("@")[0]} ليس مشرفًا بالفعل.`,
|
|
43
43
|
),
|
|
44
44
|
mentions: [targetJid],
|
|
45
45
|
});
|
|
@@ -48,7 +48,7 @@ module.exports = {
|
|
|
48
48
|
// Safety check: Cannot demote the group creator
|
|
49
49
|
if (targetUser.admin === "superadmin") {
|
|
50
50
|
return await sock.sendMessage(groupId, {
|
|
51
|
-
text: tr("The group's creator can't be demoted.", "لا يمكن عزل منشئ
|
|
51
|
+
text: tr("The group's creator can't be demoted.", "لا يمكن عزل منشئ المجموعة."),
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -21,7 +21,7 @@ module.exports = {
|
|
|
21
21
|
|
|
22
22
|
// Send a temporary message to let the user know we're working on it
|
|
23
23
|
await sock.sendMessage(groupId, {
|
|
24
|
-
text: tr("Fetching the member list...", "
|
|
24
|
+
text: tr("Fetching the member list...", "جارٍ جلب قائمة الأعضاء..."),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
// Fetch the group's metadata
|
|
@@ -33,7 +33,7 @@ module.exports = {
|
|
|
33
33
|
// Start with a header
|
|
34
34
|
let replyText = tr(
|
|
35
35
|
`*Group members:*\n*Total: ${members.length}*\n\n`,
|
|
36
|
-
`*قائمة أعضاء
|
|
36
|
+
`*قائمة أعضاء المجموعة:*\n*العدد الإجمالي: ${members.length}*\n\n`,
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
// Create an array of JIDs for the mentions property
|
|
@@ -32,7 +32,7 @@ module.exports = {
|
|
|
32
32
|
await sock.sendMessage(groupId, {
|
|
33
33
|
text: tr(
|
|
34
34
|
"This group has no rules yet. Admins can set them with `!setrules`.",
|
|
35
|
-
"لم يتم تعيين أي قواعد
|
|
35
|
+
"لم يتم تعيين أي قواعد لهذه المجموعة حتى الآن. يمكن للمشرفين تعيينها باستخدام `!setrules`.",
|
|
36
36
|
),
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -31,7 +31,7 @@ module.exports = {
|
|
|
31
31
|
return await sock.sendMessage(groupId, {
|
|
32
32
|
text: tr(
|
|
33
33
|
"⚠️ That name is too long. The limit is 25 characters.",
|
|
34
|
-
"⚠️ اسم
|
|
34
|
+
"⚠️ اسم المجموعة طويل جدًا. الحد الأقصى هو 25 حرفًا.",
|
|
35
35
|
),
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -39,14 +39,14 @@ module.exports = {
|
|
|
39
39
|
try {
|
|
40
40
|
await sock.groupUpdateSubject(groupId, newName);
|
|
41
41
|
await sock.sendMessage(groupId, {
|
|
42
|
-
text: tr(`✅ The group is now called:\n*${newName}*`, `✅ تم تغيير اسم
|
|
42
|
+
text: tr(`✅ The group is now called:\n*${newName}*`, `✅ تم تغيير اسم المجموعة بنجاح إلى:\n*${newName}*`),
|
|
43
43
|
});
|
|
44
44
|
} catch (error) {
|
|
45
45
|
logger.error({ err: error }, "Error in !group setname command");
|
|
46
46
|
await sock.sendMessage(groupId, {
|
|
47
47
|
text: tr(
|
|
48
48
|
"Something went wrong. Make sure I'm an admin and allowed to change the group's name.",
|
|
49
|
-
"حدث خطأ. تأكد من أنني مشرف ولدي صلاحية تغيير اسم
|
|
49
|
+
"حدث خطأ. تأكد من أنني مشرف ولدي صلاحية تغيير اسم المجموعة.",
|
|
50
50
|
),
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -26,14 +26,14 @@ module.exports = {
|
|
|
26
26
|
return await sock.sendMessage(groupId, {
|
|
27
27
|
text: tr(
|
|
28
28
|
"To change the group's picture, reply to the image you want with this command.",
|
|
29
|
-
"لتغيير صورة
|
|
29
|
+
"لتغيير صورة المجموعة، يرجى الرد على الصورة التي تريدها بهذا الأمر.",
|
|
30
30
|
),
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
try {
|
|
35
35
|
await sock.sendMessage(groupId, {
|
|
36
|
-
text: tr("🖼️ Changing the group's picture...", "🖼️
|
|
36
|
+
text: tr("🖼️ Changing the group's picture...", "🖼️ جارٍ تغيير صورة المجموعة..."),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
// Download the image from the quoted message
|
|
@@ -51,7 +51,7 @@ module.exports = {
|
|
|
51
51
|
await sock.updateProfilePicture(groupId, imageBuffer);
|
|
52
52
|
|
|
53
53
|
await sock.sendMessage(groupId, {
|
|
54
|
-
text: tr("✅ The group's picture was updated.", "✅ تم تحديث صورة
|
|
54
|
+
text: tr("✅ The group's picture was updated.", "✅ تم تحديث صورة المجموعة بنجاح."),
|
|
55
55
|
});
|
|
56
56
|
} catch (error) {
|
|
57
57
|
logger.error({ err: error }, "Error in !group setpp command");
|
|
@@ -39,7 +39,7 @@ module.exports = {
|
|
|
39
39
|
saveGroupSettings(groupId, settings);
|
|
40
40
|
|
|
41
41
|
await sock.sendMessage(groupId, {
|
|
42
|
-
text: tr("✅ The group's rules were saved.", "✅ تم حفظ قواعد
|
|
42
|
+
text: tr("✅ The group's rules were saved.", "✅ تم حفظ قواعد المجموعة بنجاح في قاعدة البيانات."),
|
|
43
43
|
});
|
|
44
44
|
} catch (error) {
|
|
45
45
|
// Improved logging for better debugging
|
|
@@ -25,7 +25,7 @@ module.exports = {
|
|
|
25
25
|
|
|
26
26
|
if (admins.length === 0) {
|
|
27
27
|
return await sock.sendMessage(groupId, {
|
|
28
|
-
text: tr("This group has no admins.", "لا يوجد مشرفون في
|
|
28
|
+
text: tr("This group has no admins.", "لا يوجد مشرفون في هذه المجموعة."),
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
package/src/commands/group.cjs
CHANGED
|
@@ -108,7 +108,7 @@ async function runSubCommand(sock, msg, args, body, groupMetadata, subCommand) {
|
|
|
108
108
|
// just the direct `!kick`.
|
|
109
109
|
if (runtimeConfig.isDisabled(subCommand.name)) {
|
|
110
110
|
return await sock.sendMessage(msg.key.remoteJid, {
|
|
111
|
-
text: tr("⛔ This command is turned off right now.", "⛔ الأمر
|
|
111
|
+
text: tr("⛔ This command is turned off right now.", "⛔ هذا الأمر معطّل حاليًا."),
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
|
package/src/commands/lang.cjs
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = {
|
|
|
36
36
|
`🌐 *Bot language*
|
|
37
37
|
|
|
38
38
|
⚙️ *Current:* \`${labels[currentLang] || currentLang}\`
|
|
39
|
-
• \`${prefix}lang ar\` —
|
|
39
|
+
• \`${prefix}lang ar\` — Modern Standard Arabic, always
|
|
40
40
|
• \`${prefix}lang en\` — English always
|
|
41
41
|
• \`${prefix}lang auto\` — follow the language of each message
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ Commands, !help and the AI all answer in it.
|
|
|
50
50
|
• \`${prefix}lang en\` — English always
|
|
51
51
|
• \`${prefix}lang auto\` — تلقائي حسب لغة الرسالة
|
|
52
52
|
|
|
53
|
-
الأوامر و!help والذكاء الاصطناعي
|
|
53
|
+
ستستخدمها جميع الأوامر و!help والذكاء الاصطناعي في الردود.
|
|
54
54
|
|
|
55
55
|
🔢 *لتحويل الأرقام* استخدم \`${prefix}digit\` — مثال: \`${prefix}digit 12345\``,
|
|
56
56
|
);
|
|
@@ -96,7 +96,7 @@ Commands, !help and the AI all answer in it.
|
|
|
96
96
|
await sock.sendMessage(
|
|
97
97
|
chatId,
|
|
98
98
|
{
|
|
99
|
-
text: "✅ تم ضبط لغة البوت على *العربية الفصحى*. الأوامر والذكاء الاصطناعي
|
|
99
|
+
text: "✅ تم ضبط لغة البوت على *العربية الفصحى*. ستكون ردود الأوامر والذكاء الاصطناعي بالعربية دائمًا.",
|
|
100
100
|
},
|
|
101
101
|
{ quoted: msg },
|
|
102
102
|
);
|
|
@@ -46,7 +46,7 @@ module.exports = {
|
|
|
46
46
|
const inGroup = job.targetJid.endsWith("@g.us");
|
|
47
47
|
reply += tr(
|
|
48
48
|
`*Where:* ${inGroup ? "this group" : "a private chat"}\n\n`,
|
|
49
|
-
`*الوجهة:* ${inGroup ? "
|
|
49
|
+
`*الوجهة:* ${inGroup ? "هذه المجموعة" : "محادثة خاصة"}\n\n`,
|
|
50
50
|
);
|
|
51
51
|
});
|
|
52
52
|
|
package/src/commands/loop.cjs
CHANGED
|
@@ -146,14 +146,14 @@ module.exports = {
|
|
|
146
146
|
const requested = countOf(range);
|
|
147
147
|
|
|
148
148
|
const emptyRange = () =>
|
|
149
|
-
reply(tr("❌ That range doesn't produce any numbers.", "❌
|
|
149
|
+
reply(tr("❌ That range doesn't produce any numbers.", "❌ لا ينتج هذا النطاق أي أعداد."));
|
|
150
150
|
if (requested < 1) return emptyRange();
|
|
151
151
|
if (requested > limit) {
|
|
152
152
|
return reply(
|
|
153
153
|
tr(
|
|
154
154
|
`❌ ${requested} repetitions is too many.\n` +
|
|
155
155
|
`The limit is ${limit} ${split ? "separate messages" : "repetitions in one message"}.`,
|
|
156
|
-
`❌ ${requested}
|
|
156
|
+
`❌ عدد التكرارات المطلوب (${requested}) كبير جدًا.\n` +
|
|
157
157
|
`الحد الأقصى ${limit} ${split ? "رسالة منفصلة" : "تكرار في الرسالة الواحدة"}.`,
|
|
158
158
|
),
|
|
159
159
|
);
|
|
@@ -182,7 +182,7 @@ module.exports = {
|
|
|
182
182
|
let text = lines.map((line, i) => (numbered ? `${i + 1}. ${line}` : line)).join("\n");
|
|
183
183
|
|
|
184
184
|
if (text.length > MAX_OUTPUT_CHARS) {
|
|
185
|
-
text = `${text.slice(0, MAX_OUTPUT_CHARS)}\n…\n${tr("_(cut short — too long)_", "_(
|
|
185
|
+
text = `${text.slice(0, MAX_OUTPUT_CHARS)}\n…\n${tr("_(cut short — too long)_", "_(اختُصر النص لطوله)_")}`;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
return reply(text);
|
package/src/commands/memory.cjs
CHANGED
|
@@ -42,11 +42,11 @@ function extractScope(args) {
|
|
|
42
42
|
function scopeName(scope) {
|
|
43
43
|
return scope === "global"
|
|
44
44
|
? tr("the global memory", "الذاكرة العامة")
|
|
45
|
-
: tr("this chat's memory", "ذاكرة
|
|
45
|
+
: tr("this chat's memory", "ذاكرة المحادثة");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function formatEntries(entries, { limit = 30 } = {}) {
|
|
49
|
-
if (!entries.length) return tr("_(empty)_", "_(
|
|
49
|
+
if (!entries.length) return tr("_(empty)_", "_(فارغة)_");
|
|
50
50
|
const shown = entries.slice(-limit);
|
|
51
51
|
const lines = shown.map((entry, index) => {
|
|
52
52
|
const number = entries.length - shown.length + index + 1;
|
|
@@ -58,7 +58,7 @@ function formatEntries(entries, { limit = 30 } = {}) {
|
|
|
58
58
|
const skipped = entries.length - shown.length;
|
|
59
59
|
return (
|
|
60
60
|
(skipped > 0
|
|
61
|
-
? tr(`_(+${skipped} older ones not shown)_\n\n`, `_(+${skipped} أقدم
|
|
61
|
+
? tr(`_(+${skipped} older ones not shown)_\n\n`, `_(+${skipped} معلومات أقدم لم تُعرض)_\n\n`)
|
|
62
62
|
: "") + lines.join("\n")
|
|
63
63
|
);
|
|
64
64
|
}
|
|
@@ -95,7 +95,7 @@ module.exports = {
|
|
|
95
95
|
reply(
|
|
96
96
|
tr(
|
|
97
97
|
"🚫 That's for admins and the owner only. Anyone can add to this chat's memory.",
|
|
98
|
-
"🚫
|
|
98
|
+
"🚫 هذا الإجراء للمشرفين والمالك فقط. يمكنك إضافة معلومات إلى ذاكرة هذه المحادثة.",
|
|
99
99
|
),
|
|
100
100
|
);
|
|
101
101
|
|
|
@@ -107,7 +107,7 @@ module.exports = {
|
|
|
107
107
|
return reply(
|
|
108
108
|
tr(
|
|
109
109
|
"Write the fact after the command.\nExample: `!memory add the meeting is every Tuesday at 9`",
|
|
110
|
-
"اكتب المعلومة بعد الأمر.\nمثال: `!memory add الاجتماع كل
|
|
110
|
+
"اكتب المعلومة بعد الأمر.\nمثال: `!memory add الاجتماع كل ثلاثاء الساعة ٩`",
|
|
111
111
|
),
|
|
112
112
|
);
|
|
113
113
|
}
|
|
@@ -122,7 +122,7 @@ module.exports = {
|
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
return reply(
|
|
125
|
-
tr(`🧠 Saved to *${scopeName(scope)}*.\n`, `🧠
|
|
125
|
+
tr(`🧠 Saved to *${scopeName(scope)}*.\n`, `🧠 حُفظت في *${scopeName(scope)}*.\n`) +
|
|
126
126
|
`\`${entry.id}\` — ${content.length > 80 ? content.slice(0, 80) + "…" : content}`,
|
|
127
127
|
);
|
|
128
128
|
}
|
|
@@ -131,19 +131,19 @@ module.exports = {
|
|
|
131
131
|
if (["search", "find", "بحث", "دور"].includes(action)) {
|
|
132
132
|
const query = rest.join(" ").trim();
|
|
133
133
|
if (!query) {
|
|
134
|
-
return reply(tr("Write the word you're looking for.", "اكتب الكلمة
|
|
134
|
+
return reply(tr("Write the word you're looking for.", "اكتب الكلمة التي تبحث عنها."));
|
|
135
135
|
}
|
|
136
136
|
const chatHits = memory.searchMemory(query, { scope: "chat", chatId });
|
|
137
137
|
const globalHits = memory.searchMemory(query, { scope: "global" });
|
|
138
138
|
|
|
139
139
|
if (!chatHits.length && !globalHits.length) {
|
|
140
140
|
return reply(
|
|
141
|
-
tr(`🔍 Nothing is saved about "${query}".`, `🔍
|
|
141
|
+
tr(`🔍 Nothing is saved about "${query}".`, `🔍 لا توجد معلومات محفوظة عن "${query}".`),
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
return reply(
|
|
145
|
-
tr(`🔍 *Results for* "${query}"\n\n`, `🔍
|
|
146
|
-
tr(`*This chat (${chatHits.length}):*\n`, `*ذاكرة
|
|
145
|
+
tr(`🔍 *Results for* "${query}"\n\n`, `🔍 *نتائج البحث عن* "${query}"\n\n`) +
|
|
146
|
+
tr(`*This chat (${chatHits.length}):*\n`, `*ذاكرة المحادثة (${chatHits.length}):*\n`) +
|
|
147
147
|
`${formatEntries(chatHits, { limit: 10 })}\n\n` +
|
|
148
148
|
tr(`*Global (${globalHits.length}):*\n`, `*الذاكرة العامة (${globalHits.length}):*\n`) +
|
|
149
149
|
formatEntries(globalHits, { limit: 10 }),
|
|
@@ -158,7 +158,7 @@ module.exports = {
|
|
|
158
158
|
return reply(
|
|
159
159
|
tr(
|
|
160
160
|
"Say what to forget: its number from `!memory`, or part of its text.\nExample: `!memory forget 3`",
|
|
161
|
-
"
|
|
161
|
+
"حدّد ما تريد حذفه: رقمه من `!memory` أو جزء من نصه.\n" +
|
|
162
162
|
"مثال: `!memory forget 3`",
|
|
163
163
|
),
|
|
164
164
|
);
|
|
@@ -168,11 +168,11 @@ module.exports = {
|
|
|
168
168
|
removed
|
|
169
169
|
? tr(
|
|
170
170
|
`🗑️ Forgotten: ${removed.content.slice(0, 120)}`,
|
|
171
|
-
`🗑️
|
|
171
|
+
`🗑️ حُذفت: ${removed.content.slice(0, 120)}`,
|
|
172
172
|
)
|
|
173
173
|
: tr(
|
|
174
174
|
`Nothing in ${scopeName(scope)} matches "${ref}".`,
|
|
175
|
-
|
|
175
|
+
`لم أجد ما يطابق "${ref}" في ${scopeName(scope)}.`,
|
|
176
176
|
),
|
|
177
177
|
);
|
|
178
178
|
}
|
|
@@ -185,9 +185,9 @@ module.exports = {
|
|
|
185
185
|
count
|
|
186
186
|
? tr(
|
|
187
187
|
`🧹 Cleared *${count}* facts from ${scopeName(scope)}.`,
|
|
188
|
-
`🧹
|
|
188
|
+
`🧹 حُذفت *${count}* معلومة من ${scopeName(scope)}.`,
|
|
189
189
|
)
|
|
190
|
-
: tr("The memory was already empty.", "الذاكرة
|
|
190
|
+
: tr("The memory was already empty.", "الذاكرة فارغة بالفعل."),
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -199,7 +199,7 @@ module.exports = {
|
|
|
199
199
|
return reply(
|
|
200
200
|
tr(
|
|
201
201
|
"There is no memory file yet — start with `!memory add ...`.",
|
|
202
|
-
"
|
|
202
|
+
"لا يوجد ملف ذاكرة بعد — ابدأ بـ `!memory add ...`.",
|
|
203
203
|
),
|
|
204
204
|
);
|
|
205
205
|
}
|
|
@@ -228,10 +228,10 @@ module.exports = {
|
|
|
228
228
|
`${formatEntries(entries)}\n\n` +
|
|
229
229
|
`_Chat: ${stats.chatCount} · Global: ${stats.globalCount}_\n` +
|
|
230
230
|
"`!memory add <fact>` · `!memory add global <fact>` · `!memory forget <number>` · `!memory file`",
|
|
231
|
-
`🧠 *${target === "global" ? "الذاكرة العامة" : "ذاكرة المحادثة
|
|
231
|
+
`🧠 *${target === "global" ? "الذاكرة العامة" : "ذاكرة هذه المحادثة"}* ` +
|
|
232
232
|
`(${entries.length} معلومة)\n\n` +
|
|
233
233
|
`${formatEntries(entries)}\n\n` +
|
|
234
|
-
`_
|
|
234
|
+
`_المحادثة: ${stats.chatCount} · العام: ${stats.globalCount}_\n` +
|
|
235
235
|
"`!memory add <معلومة>` · `!memory add global <معلومة>` · `!memory forget <رقم>` · `!memory file`",
|
|
236
236
|
),
|
|
237
237
|
);
|
package/src/commands/notes.cjs
CHANGED
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
|
22
22
|
|
|
23
23
|
if (keywords.length === 0) {
|
|
24
24
|
return await sock.sendMessage(groupId, {
|
|
25
|
-
text: tr("This group has no saved notes.", "لا توجد ملاحظات محفوظة في
|
|
25
|
+
text: tr("This group has no saved notes.", "لا توجد ملاحظات محفوظة في هذه المجموعة."),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
package/src/commands/perm.cjs
CHANGED
|
@@ -76,7 +76,7 @@ function labelFor(user) {
|
|
|
76
76
|
// is async — awaiting them is not optional.
|
|
77
77
|
async function rolesReport() {
|
|
78
78
|
const { owners, admins, bootstrapOwners, bootstrapAdmins } = await listRoles();
|
|
79
|
-
const none = tr("• (none)", "• (
|
|
79
|
+
const none = tr("• (none)", "• (لا شيء)");
|
|
80
80
|
const lines = [tr("*🔑 Bot roles*", "*🔑 صلاحيات البوت*"), ""];
|
|
81
81
|
|
|
82
82
|
lines.push(tr(`*👑 Owners (${owners.length}):*`, `*👑 المالكين (${owners.length}):*`));
|
|
@@ -220,7 +220,7 @@ module.exports = {
|
|
|
220
220
|
{
|
|
221
221
|
text: tr(
|
|
222
222
|
`❌ *I couldn't change the role*\n\n*Details:* ${error.message}`,
|
|
223
|
-
`❌
|
|
223
|
+
`❌ *تعذّر تعديل الصلاحية*\n\n*التفاصيل:* ${error.message}`,
|
|
224
224
|
),
|
|
225
225
|
},
|
|
226
226
|
{ replyTo: msg },
|
package/src/commands/poll.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// استفتاء — !poll
|
|
2
2
|
//
|
|
3
|
-
// !poll
|
|
4
|
-
// !poll --multi اختر
|
|
3
|
+
// !poll إلى أين نذهب اليوم؟ | السينما | البحر | نبقى في المنزل
|
|
4
|
+
// !poll --multi اختر طعامك | كشري | دجاج | بيتزا (يسمح بأكثر من خيار)
|
|
5
5
|
//
|
|
6
6
|
// Sends a native WhatsApp poll (not a text list), so members vote with a tap
|
|
7
7
|
// and WhatsApp counts the results.
|
|
@@ -36,7 +36,7 @@ const HELP_TEXT_AR =
|
|
|
36
36
|
"*خيارات:*\n" +
|
|
37
37
|
"`--multi` يسمح باختيار أكتر من إجابة\n\n" +
|
|
38
38
|
"*مثال:*\n" +
|
|
39
|
-
"`!poll
|
|
39
|
+
"`!poll إلى أين نذهب؟ | السينما | البحر | البيت`\n\n" +
|
|
40
40
|
`_من ${MIN_OPTIONS} لـ ${MAX_OPTIONS} خيارات._`;
|
|
41
41
|
|
|
42
42
|
/**
|
package/src/commands/rand.cjs
CHANGED
|
@@ -46,7 +46,7 @@ const HELP_TEXT_AR =
|
|
|
46
46
|
"🎲 *عشوائي*\n\n" +
|
|
47
47
|
"`!rand` رقم من 1 لـ 100\n" +
|
|
48
48
|
"`!rand <أقصى>` رقم من 1 للرقم ده\n" +
|
|
49
|
-
"`!rand <أدنى> <أقصى>` رقم بين
|
|
49
|
+
"`!rand <أدنى> <أقصى>` رقم بين الحدّين\n" +
|
|
50
50
|
"`!rand dice [عدد d أوجه]` نرد — مثال `!rand dice 2d6`\n" +
|
|
51
51
|
"`!rand coin` ملك ولا كتابة\n" +
|
|
52
52
|
"`!rand pick خيار | خيار | خيار` يختار واحد";
|
|
@@ -127,7 +127,7 @@ module.exports = {
|
|
|
127
127
|
return reply(
|
|
128
128
|
tr(
|
|
129
129
|
`❌ Too many options (the limit is ${MAX_CHOICES}).`,
|
|
130
|
-
`❌ الخيارات
|
|
130
|
+
`❌ الخيارات كثيرة جدًا (الحد ${MAX_CHOICES}).`,
|
|
131
131
|
),
|
|
132
132
|
);
|
|
133
133
|
}
|