Spaces:
Paused
Paused
πππ₯π₯πππ π π¨ππππ₯π β‘
commited on
Update and rename tools-bot.js to wa-presence.js
Browse files- plugins/tools-bot.js +0 -72
- plugins/wa-presence.js +37 -0
plugins/tools-bot.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
| 1 |
-
/*
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
const fs = require('fs');
|
| 11 |
-
const path = require('path');
|
| 12 |
-
const { CURRENT_STATUS, ALWAYS_ONLINE, FAKE_TYPING } = require('../config');
|
| 13 |
-
const { cmd, commands } = require('../command');
|
| 14 |
-
|
| 15 |
-
// Commande body
|
| 16 |
-
cmd({
|
| 17 |
-
pattern: 'body',
|
| 18 |
-
react: 'π',
|
| 19 |
-
desc: 'Sends typing status.',
|
| 20 |
-
category: 'status',
|
| 21 |
-
filename: __filename
|
| 22 |
-
}, async (_conn, _mek, _m, { body, reply }) => {
|
| 23 |
-
if (CURRENT_STATUS === true) {
|
| 24 |
-
_conn.sendPresenceUpdate('composing', _mek.key.remoteJid);
|
| 25 |
-
} else {
|
| 26 |
-
_conn.sendPresenceUpdate('available', _mek.key.remoteJid);
|
| 27 |
-
}
|
| 28 |
-
});
|
| 29 |
-
|
| 30 |
-
// Commande available
|
| 31 |
-
cmd({
|
| 32 |
-
pattern: 'available',
|
| 33 |
-
react: 'π’',
|
| 34 |
-
desc: 'Sets bot status as available or unavailable.',
|
| 35 |
-
category: 'status',
|
| 36 |
-
filename: __filename
|
| 37 |
-
}, async (_conn, _mek, _m, { isOwner, reply }) => {
|
| 38 |
-
if (ALWAYS_ONLINE === true) {
|
| 39 |
-
_conn.sendPresenceUpdate('available', _mek.key.remoteJid);
|
| 40 |
-
} else {
|
| 41 |
-
_conn.sendPresenceUpdate('unavailable', _mek.key.remoteJid);
|
| 42 |
-
}
|
| 43 |
-
});
|
| 44 |
-
|
| 45 |
-
// Commande composing (fake typing)
|
| 46 |
-
cmd({
|
| 47 |
-
pattern: 'composing',
|
| 48 |
-
react: 'βοΈ',
|
| 49 |
-
desc: 'Simulates typing.',
|
| 50 |
-
category: 'status',
|
| 51 |
-
filename: __filename
|
| 52 |
-
}, async (_conn, _mek, _m, { body, reply }) => {
|
| 53 |
-
if (FAKE_TYPING === true) {
|
| 54 |
-
_conn.sendPresenceUpdate('composing', _mek.key.remoteJid);
|
| 55 |
-
}
|
| 56 |
-
});
|
| 57 |
-
|
| 58 |
-
// Commande pour afficher l'Γ©tat du bot
|
| 59 |
-
cmd({
|
| 60 |
-
pattern: 'status',
|
| 61 |
-
react: 'βοΈ',
|
| 62 |
-
desc: 'Display the current status of the bot.',
|
| 63 |
-
category: 'tools',
|
| 64 |
-
filename: __filename
|
| 65 |
-
}, async (_conn, _mek, _m, { reply }) => {
|
| 66 |
-
let statusMessage = `Bot status:\n`;
|
| 67 |
-
statusMessage += `Current status: ${CURRENT_STATUS ? 'Active' : 'Inactive'}\n`;
|
| 68 |
-
statusMessage += `Always online: ${ALWAYS_ONLINE ? 'Yes' : 'No'}\n`;
|
| 69 |
-
statusMessage += `Fake typing: ${FAKE_TYPING ? 'Enabled' : 'Disabled'}`;
|
| 70 |
-
reply(statusMessage);
|
| 71 |
-
});
|
| 72 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins/wa-presence.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const fs = require('fs');
|
| 2 |
+
const path = require('path');
|
| 3 |
+
const config = require('../config')
|
| 4 |
+
const {cmd , commands} = require('../command')
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
// Composing (Auto Typing)
|
| 8 |
+
cmd({
|
| 9 |
+
on: "body"
|
| 10 |
+
},
|
| 11 |
+
async (conn, mek, m, { from, body, isOwner }) => {
|
| 12 |
+
if (config.AUTO_TYPING === 'true') {
|
| 13 |
+
await conn.sendPresenceUpdate('composing', from); // send typing
|
| 14 |
+
}
|
| 15 |
+
});
|
| 16 |
+
|
| 17 |
+
// Always Online / Available
|
| 18 |
+
cmd({
|
| 19 |
+
on: "body"
|
| 20 |
+
},
|
| 21 |
+
async (conn, mek, m, { from, body, isOwner }) => {
|
| 22 |
+
if (config.ALWAYS_ONLINE === 'true') {
|
| 23 |
+
await conn.sendPresenceUpdate('available', from); // Explicitly show online
|
| 24 |
+
} else {
|
| 25 |
+
await conn.sendPresenceUpdate('unavailable', from); // Explicitly set to offline
|
| 26 |
+
}
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
// Current (Idle/Neutral)
|
| 30 |
+
cmd({
|
| 31 |
+
on: "body"
|
| 32 |
+
},
|
| 33 |
+
async (conn, mek, m, { from, body, isOwner }) => {
|
| 34 |
+
if (config.CURRENT_STATUS === 'true') {
|
| 35 |
+
await conn.sendPresenceUpdate('null', from); // Null state (idle or default)
|
| 36 |
+
}
|
| 37 |
+
});
|