levix-bot 4.3.0 → 4.4.0
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/README.md +1 -0
- package/package.json +1 -1
- package/public/dashboard/assets/index-5P8GnKLg.css +2 -0
- package/public/dashboard/assets/index-DXzno3X6.js +515 -0
- package/public/dashboard/index.html +2 -2
- package/public/dashboard.css +32 -0
- package/src/bootstrap/panel.js +16 -4
- package/src/commands/autoschedule.cjs +1 -1
- package/src/commands/blacklist.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/pack.cjs +159 -0
- package/src/commands/packs.cjs +47 -0
- 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 +4 -4
- package/src/commands/schedule.cjs +1 -1
- package/src/commands/send.cjs +3 -20
- package/src/commands/status.cjs +2 -2
- package/src/commands/sticker.cjs +77 -232
- package/src/commands/stickers.cjs +100 -0
- package/src/commands/stopbot.cjs +5 -5
- package/src/commands/stt.cjs +1 -1
- package/src/commands/toimage.cjs +88 -0
- package/src/commands/tts.cjs +2 -2
- package/src/config/defaults.cjs +5 -0
- package/src/config/settings.cjs +10 -0
- package/src/core/events.js +15 -1
- package/src/core/session.js +7 -0
- package/src/db/db.cjs +381 -0
- package/src/db/store.cjs +729 -21
- package/src/handlers/command.handler.js +5 -1
- package/src/panel/password-reset.cjs +1 -1
- package/src/routes/dashboard.api.esm.js +43 -10
- package/src/routes/stickers.api.esm.js +570 -0
- package/src/services/aiAgent.cjs +2 -2
- package/src/services/aiProviders.cjs +1 -1
- package/src/services/aiTools.cjs +27 -27
- package/src/stickers/errors.cjs +239 -0
- package/src/stickers/ffmpeg.cjs +133 -0
- package/src/stickers/jobs.cjs +183 -0
- package/src/stickers/library.cjs +712 -0
- package/src/stickers/limits.cjs +60 -0
- package/src/stickers/media.cjs +748 -0
- package/src/stickers/options.cjs +128 -0
- package/src/stickers/owner.cjs +103 -0
- package/src/stickers/studio.cjs +473 -0
- package/src/stickers/uploads.cjs +263 -0
- package/src/stickers/webp.cjs +231 -0
- package/src/stickers/zip.cjs +107 -0
- package/src/utils/memory.cjs +7 -7
- package/src/utils/messageContent.cjs +30 -4
- package/src/utils/recurrence.cjs +189 -30
- package/src/utils/stickerBot.cjs +84 -0
- package/src/utils/storage.cjs +3 -0
- package/src/utils/storage.esm.js +3 -0
- package/views/login.ejs +39 -3
- package/views/setup.ejs +21 -0
- package/public/dashboard/assets/index-BCXZoPGP.js +0 -446
- package/public/dashboard/assets/index-LvfJ8ybs.css +0 -2
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
11
11
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
12
12
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Tajawal:wght@400;500;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
13
|
-
<script type="module" crossorigin src="/dashboard/assets/index-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/dashboard/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/dashboard/assets/index-DXzno3X6.js"></script>
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/dashboard/assets/index-5P8GnKLg.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/public/dashboard.css
CHANGED
|
@@ -2973,3 +2973,35 @@ html.screen-guard .gateway-panel {
|
|
|
2973
2973
|
display: none;
|
|
2974
2974
|
}
|
|
2975
2975
|
}
|
|
2976
|
+
|
|
2977
|
+
.gateway-back-btn {
|
|
2978
|
+
display: inline-flex;
|
|
2979
|
+
align-items: center;
|
|
2980
|
+
gap: 0.375rem;
|
|
2981
|
+
padding: 0.375rem 0.625rem;
|
|
2982
|
+
margin-bottom: 0.75rem;
|
|
2983
|
+
border-radius: 0.625rem;
|
|
2984
|
+
border: 1px solid var(--line);
|
|
2985
|
+
background: var(--panel-raised);
|
|
2986
|
+
color: var(--text-main);
|
|
2987
|
+
font-size: 0.8125rem;
|
|
2988
|
+
font-weight: 500;
|
|
2989
|
+
cursor: pointer;
|
|
2990
|
+
transition: background 0.15s, color 0.15s;
|
|
2991
|
+
line-height: 1;
|
|
2992
|
+
}
|
|
2993
|
+
.gateway-back-btn[hidden] {
|
|
2994
|
+
display: none;
|
|
2995
|
+
}
|
|
2996
|
+
.gateway-back-btn:hover {
|
|
2997
|
+
background: var(--panel-hover);
|
|
2998
|
+
color: var(--brand-cyan);
|
|
2999
|
+
}
|
|
3000
|
+
.gateway-back-btn svg {
|
|
3001
|
+
width: 1rem;
|
|
3002
|
+
height: 1rem;
|
|
3003
|
+
flex-shrink: 0;
|
|
3004
|
+
}
|
|
3005
|
+
.gateway-back-btn[dir="rtl"] svg {
|
|
3006
|
+
transform: scaleX(-1);
|
|
3007
|
+
}
|
package/src/bootstrap/panel.js
CHANGED
|
@@ -46,10 +46,19 @@ export async function bootstrapPanel({ core } = {}) {
|
|
|
46
46
|
const { default: dashboardApiRoutes, setSession } = await import(
|
|
47
47
|
"../routes/dashboard.api.esm.js"
|
|
48
48
|
);
|
|
49
|
+
const stickerApi = await import("../routes/stickers.api.esm.js");
|
|
49
50
|
|
|
50
|
-
// Same session as the control panel
|
|
51
|
-
//
|
|
52
|
-
|
|
51
|
+
// Same session as the control panel. One chain and one JSON parser: the
|
|
52
|
+
// sticker upload is raw bytes (any Content-Type, up to the upload cap) and
|
|
53
|
+
// express.json would consume it before the route can enforce that cap.
|
|
54
|
+
app.use(
|
|
55
|
+
"/dashboard/api",
|
|
56
|
+
requireLoginApi,
|
|
57
|
+
noStore,
|
|
58
|
+
stickerApi.jsonUnlessStickerUpload(dashboardJson),
|
|
59
|
+
stickerApi.default,
|
|
60
|
+
dashboardApiRoutes,
|
|
61
|
+
);
|
|
53
62
|
logger.info("Dashboard API routes registered");
|
|
54
63
|
|
|
55
64
|
// Everything the bot reports goes out to the browsers watching the panel.
|
|
@@ -65,7 +74,10 @@ export async function bootstrapPanel({ core } = {}) {
|
|
|
65
74
|
|
|
66
75
|
// The routes read the live socket off the session manager, so a reconnect
|
|
67
76
|
// needs no re-wiring here.
|
|
68
|
-
if (core?.session)
|
|
77
|
+
if (core?.session) {
|
|
78
|
+
setSession(core.session);
|
|
79
|
+
stickerApi.setSession(core.session);
|
|
80
|
+
}
|
|
69
81
|
// The WhatsApp-code password reset talks to the same session manager.
|
|
70
82
|
if (core?.session) require("../panel/password-reset.cjs").setSession(core.session);
|
|
71
83
|
|
|
@@ -64,7 +64,7 @@ module.exports = {
|
|
|
64
64
|
return await sock.sendMessage(creatorJid, {
|
|
65
65
|
text: tr(
|
|
66
66
|
"I couldn't schedule that message. Check the time and try again.",
|
|
67
|
-
"
|
|
67
|
+
"تعذّرت جدولة هذه الرسالة. راجع الوقت وحاول مرة أخرى.",
|
|
68
68
|
),
|
|
69
69
|
});
|
|
70
70
|
}
|
|
@@ -118,7 +118,7 @@ module.exports = {
|
|
|
118
118
|
return await sock.sendMessage(groupId, {
|
|
119
119
|
text: tr(
|
|
120
120
|
`@${normalizedTargetJid.split("@")[0]} isn't on the blacklist.`,
|
|
121
|
-
`العضو @${normalizedTargetJid.split("@")[0]} ليس في القائمة السوداء
|
|
121
|
+
`العضو @${normalizedTargetJid.split("@")[0]} ليس في القائمة السوداء بالفعل.`,
|
|
122
122
|
),
|
|
123
123
|
mentions: [normalizedTargetJid],
|
|
124
124
|
});
|
package/src/commands/calc.cjs
CHANGED
|
@@ -62,10 +62,10 @@ const FUNCTIONS = {
|
|
|
62
62
|
function factorial(n) {
|
|
63
63
|
if (!Number.isInteger(n)) {
|
|
64
64
|
throw new CalcError(
|
|
65
|
-
tr("Factorial (!) only works on whole numbers", "المضروب (!)
|
|
65
|
+
tr("Factorial (!) only works on whole numbers", "يُحسب المضروب (!) للأعداد الصحيحة فقط"),
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
if (n < 0) throw new CalcError(tr("Negative numbers have no factorial", "
|
|
68
|
+
if (n < 0) throw new CalcError(tr("Negative numbers have no factorial", "لا يُعرَّف المضروب للأعداد السالبة"));
|
|
69
69
|
if (n > 170) return Infinity; // beyond this a double is Infinity anyway
|
|
70
70
|
let result = 1;
|
|
71
71
|
for (let i = 2; i <= n; i++) result *= i;
|
|
@@ -154,7 +154,7 @@ function tokenize(text) {
|
|
|
154
154
|
continue;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
throw new CalcError(tr(`Unknown symbol: \`${char}\``, `رمز
|
|
157
|
+
throw new CalcError(tr(`Unknown symbol: \`${char}\``, `رمز غير معروف: \`${char}\``));
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
return tokens;
|
|
@@ -207,7 +207,7 @@ function parse(tokens) {
|
|
|
207
207
|
pos++;
|
|
208
208
|
const right = parseUnary();
|
|
209
209
|
if (right === 0) {
|
|
210
|
-
throw new CalcError(tr("Modulo by zero isn't defined", "باقي القسمة على صفر
|
|
210
|
+
throw new CalcError(tr("Modulo by zero isn't defined", "باقي القسمة على صفر غير معرّف"));
|
|
211
211
|
}
|
|
212
212
|
left %= right;
|
|
213
213
|
} else if (startsValue(peek())) {
|
|
@@ -297,7 +297,7 @@ function parse(tokens) {
|
|
|
297
297
|
|
|
298
298
|
if (name in CONSTANTS) return CONSTANTS[name];
|
|
299
299
|
|
|
300
|
-
throw new CalcError(tr(`I don't know what \`${name}\` is`,
|
|
300
|
+
throw new CalcError(tr(`I don't know what \`${name}\` is`, `لا أعرف معنى \`${name}\``));
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
throw new CalcError(
|
|
@@ -318,12 +318,12 @@ function evaluate(expression) {
|
|
|
318
318
|
const normalized = normalize(expression);
|
|
319
319
|
if (!normalized) throw new CalcError(tr("Type an expression first", "اكتب معادلة الأول"));
|
|
320
320
|
if (normalized.length > 300) {
|
|
321
|
-
throw new CalcError(tr("The expression is too long", "
|
|
321
|
+
throw new CalcError(tr("The expression is too long", "التعبير الرياضي طويل جدًا"));
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
const value = parse(tokenize(normalized));
|
|
325
325
|
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
326
|
-
throw new CalcError(tr("The result isn't a valid number", "النتيجة
|
|
326
|
+
throw new CalcError(tr("The result isn't a valid number", "النتيجة ليست عددًا صالحًا"));
|
|
327
327
|
}
|
|
328
328
|
return { normalized, value };
|
|
329
329
|
}
|
|
@@ -425,14 +425,14 @@ module.exports = {
|
|
|
425
425
|
const reason =
|
|
426
426
|
error instanceof CalcError
|
|
427
427
|
? error.message
|
|
428
|
-
: tr("I couldn't understand that expression", "
|
|
428
|
+
: tr("I couldn't understand that expression", "تعذّر فهم التعبير الرياضي");
|
|
429
429
|
return sendBotMessage(
|
|
430
430
|
sock,
|
|
431
431
|
chatId,
|
|
432
432
|
{
|
|
433
433
|
text: tr(
|
|
434
434
|
`❌ ${reason}\n\nSend \`!calc\` on its own to see examples.`,
|
|
435
|
-
`❌ ${reason}\n\nاكتب \`!calc\`
|
|
435
|
+
`❌ ${reason}\n\nاكتب \`!calc\` وحده لعرض الأمثلة.`,
|
|
436
436
|
),
|
|
437
437
|
},
|
|
438
438
|
{ replyTo: msg },
|
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);
|