levix-bot 3.3.0-rc.2 → 4.0.0-beta
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 +11 -7
- package/app.cjs +42 -45
- package/package.json +9 -1
- package/public/dashboard/assets/index-C1b7ijfu.js +391 -0
- package/public/dashboard/assets/index-pYaivHON.css +1 -0
- package/public/dashboard/index.html +19 -0
- package/public/dashboard.css +391 -66
- package/public/dashboard.js +593 -42
- package/scheduler.cjs +9 -14
- package/src/auth/use-database-auth-state.js +2 -4
- package/src/bootstrap/core.js +2 -5
- package/src/bootstrap/panel.js +10 -5
- package/src/cli.js +3 -5
- package/src/commands/autoschedule.cjs +1 -4
- package/src/commands/blacklist.cjs +22 -20
- package/src/commands/block.cjs +2 -4
- package/src/commands/calc.cjs +9 -16
- package/src/commands/digit.cjs +97 -0
- package/src/commands/gemini.cjs +147 -161
- package/src/commands/group/add.cjs +7 -16
- package/src/commands/group/antiSpam.cjs +5 -11
- package/src/commands/group/antilink.cjs +34 -28
- package/src/commands/group/approveall.cjs +3 -11
- package/src/commands/group/clearwarns.cjs +2 -5
- package/src/commands/group/demote.cjs +3 -8
- package/src/commands/group/kick.cjs +12 -15
- package/src/commands/group/media.cjs +17 -24
- package/src/commands/group/members.cjs +1 -2
- package/src/commands/group/promote.cjs +4 -12
- package/src/commands/group/removeall.cjs +2 -5
- package/src/commands/group/setpp.cjs +1 -1
- package/src/commands/group/setrules.cjs +2 -8
- package/src/commands/group/setwarn.cjs +4 -2
- package/src/commands/group/tagadmins.cjs +2 -5
- package/src/commands/group/warn.cjs +26 -24
- package/src/commands/group/warns.cjs +1 -2
- package/src/commands/group/welcome.cjs +13 -17
- package/src/commands/group.cjs +7 -10
- package/src/commands/help.cjs +6 -12
- package/src/commands/lang.cjs +104 -0
- package/src/commands/listschedules.cjs +2 -6
- package/src/commands/loop.cjs +6 -13
- package/src/commands/memory.cjs +19 -32
- package/src/commands/mod.cjs +97 -35
- package/src/commands/perm.cjs +18 -56
- package/src/commands/ping.cjs +1 -5
- package/src/commands/poll.cjs +1 -1
- package/src/commands/rand.cjs +2 -5
- package/src/commands/schedule.cjs +4 -8
- package/src/commands/score.cjs +8 -2
- package/src/commands/setprefix.cjs +2 -2
- package/src/commands/shortlink.cjs +7 -15
- package/src/commands/shutdown.cjs +1 -1
- package/src/commands/sticker.cjs +222 -0
- package/src/commands/stt.cjs +136 -68
- package/src/commands/todo.cjs +9 -15
- package/src/commands/tts.cjs +10 -16
- package/src/commands/unblock.cjs +2 -6
- package/src/commands/weather.cjs +5 -12
- package/src/config/ai-persona.md +5 -3
- package/src/config/available-models.json +1156 -0
- package/src/config/baileys.config.js +2 -1
- package/src/config/brand.esm.js +1 -10
- package/src/config/constants.js +1 -1
- package/src/config/defaults.cjs +66 -66
- package/src/config/lock.cjs +2 -2
- package/src/config/modelCapabilities.cjs +172 -0
- package/src/config/runtime-config.cjs +8 -13
- package/src/config/secrets.cjs +18 -10
- package/src/config/settings.cjs +94 -10
- package/src/config/vault.cjs +107 -0
- package/src/core/connection.js +13 -12
- package/src/core/events.js +41 -23
- package/src/core/proxy.js +7 -7
- package/src/core/session.js +91 -48
- package/src/core/socket.js +12 -15
- package/src/db/db.cjs +14 -6
- package/src/db/store.cjs +221 -87
- package/src/domain/caddy.js +1 -1
- package/src/domain/command.js +40 -19
- package/src/domain/detect.js +1 -1
- package/src/domain/system.js +2 -5
- package/src/handlers/command.handler.js +22 -43
- package/src/handlers/group.handler.js +13 -13
- package/src/handlers/message.handler.js +11 -21
- package/src/index.js +8 -4
- package/src/middleware/antispam.middleware.js +46 -23
- package/src/middleware/blacklist.middleware.js +14 -9
- package/src/middleware/forward-tracking.middleware.js +3 -2
- package/src/middleware/permissions.middleware.js +7 -10
- package/src/panel/login-throttle.cjs +43 -0
- package/src/panel/session-auth.cjs +17 -0
- package/src/routes/dashboard.api.esm.js +394 -72
- package/src/services/aiAgent.cjs +136 -49
- package/src/services/aiProviders.cjs +193 -47
- package/src/services/aiRouter.cjs +137 -0
- package/src/services/aiTools.cjs +305 -125
- package/src/services/llmDiscovery.cjs +481 -0
- package/src/services/modelRegistry.cjs +412 -0
- package/src/utils/datetime.cjs +2 -2
- package/src/utils/lid-helper.esm.js +7 -7
- package/src/utils/logger.cjs +1 -1
- package/src/utils/markdownParser.cjs +159 -0
- package/src/utils/memory.cjs +43 -13
- package/src/utils/messageContent.cjs +40 -0
- package/src/utils/normalizeJid.esm.js +7 -7
- package/src/utils/numerals.cjs +75 -0
- package/src/utils/permissions.esm.js +10 -15
- package/src/utils/providerUrl.cjs +281 -0
- package/src/utils/recurrence.cjs +7 -11
- package/src/utils/sendBotMessage.esm.js +4 -14
- package/src/utils/statusMessage.cjs +5 -13
- package/src/utils/storage.cjs +10 -0
- package/src/utils/storage.esm.js +11 -0
- package/src/utils/textDecode.cjs +4 -9
- package/src/utils/thumbnail.cjs +8 -14
- package/src/utils/typing.esm.js +12 -12
- package/views/dashboard.ejs +134 -106
package/src/commands/weather.cjs
CHANGED
|
@@ -28,12 +28,9 @@ module.exports = {
|
|
|
28
28
|
const API_URL = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric&lang=ar`;
|
|
29
29
|
|
|
30
30
|
// One message: it starts as "looking it up" and turns into the forecast.
|
|
31
|
-
const status = await createStatus(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`🔍 بدور على طقس ${city}...`,
|
|
35
|
-
{ replyTo: msg },
|
|
36
|
-
);
|
|
31
|
+
const status = await createStatus(sock, msg.key.remoteJid, `🔍 بدور على طقس ${city}...`, {
|
|
32
|
+
replyTo: msg,
|
|
33
|
+
});
|
|
37
34
|
|
|
38
35
|
try {
|
|
39
36
|
const response = await axios.get(API_URL);
|
|
@@ -60,15 +57,11 @@ module.exports = {
|
|
|
60
57
|
// التعامل مع الأخطاء
|
|
61
58
|
if (error.response && error.response.status === 404) {
|
|
62
59
|
// خطأ 404 يعني أن المدينة غير موجودة
|
|
63
|
-
await status.finish(
|
|
64
|
-
`لم أتمكن من العثور على مدينة باسم "${city}". يرجى التحقق من الاسم.`,
|
|
65
|
-
);
|
|
60
|
+
await status.finish(`لم أتمكن من العثور على مدينة باسم "${city}". يرجى التحقق من الاسم.`);
|
|
66
61
|
} else if (error.response && error.response.status === 401) {
|
|
67
62
|
// خطأ 401 يعني أن مفتاح الـ API غير صالح
|
|
68
63
|
logger.error("[Error] Invalid API Key for OpenWeatherMap.");
|
|
69
|
-
await status.finish(
|
|
70
|
-
`حدث خطأ في المصادقة مع خدمة الطقس. يرجى مراجعة مفتاح الـ API.`,
|
|
71
|
-
);
|
|
64
|
+
await status.finish(`حدث خطأ في المصادقة مع خدمة الطقس. يرجى مراجعة مفتاح الـ API.`);
|
|
72
65
|
} else {
|
|
73
66
|
// أي أخطاء أخرى
|
|
74
67
|
logger.error(error.message, "[Error] in Weather API:");
|
package/src/config/ai-persona.md
CHANGED
|
@@ -17,9 +17,11 @@ useful rather than decorative.
|
|
|
17
17
|
sentences, not an essay. Expand properly when the person asks for detail,
|
|
18
18
|
wants something explained, or the question genuinely needs the length.
|
|
19
19
|
- Match the language the person writes in, and keep matching it as the
|
|
20
|
-
conversation goes on.
|
|
21
|
-
|
|
22
|
-
Standard Arabic
|
|
20
|
+
conversation goes on. In Arabic, even when someone writes in Egyptian Arabic or
|
|
21
|
+
local dialects, always reply in clear, natural, and grammatically sound Modern
|
|
22
|
+
Standard Arabic rather than colloquial slang, while keeping the phrasing direct,
|
|
23
|
+
natural, and free from excessive formality. The same natural clarity applies to
|
|
24
|
+
any other language used.
|
|
23
25
|
- Write for WhatsApp, not for a web page. Use `*bold*`, `_italic_`,
|
|
24
26
|
`~strikethrough~` and backticks for code or commands. Do not use Markdown
|
|
25
27
|
headings, tables, horizontal rules or nested bullets — they render as literal
|