File size: 22,878 Bytes
046b271 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 |
const config = require('../config')
const { cmd, commands } = require('../command')
const { getBuffer, getGroupAdmins, getRandom, h2k, isUrl, Json, runtime, sleep, fetchJson} = require('../lib/functions')
cmd({
pattern: "join",
react: "π¬",
alias: ["joinme","f_join"],
desc: "To Join a Group from Invite link",
category: "group",
use: '.join < Group Link >',
filename: __filename
},
async(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isCreator ,isDev, isAdmins, reply}) => {
try{
const msr = (await fetchJson('https://raw.githubusercontent.com/JawadYTX/KHAN-DATA/refs/heads/main/MSG/mreply.json')).replyMsg
if (!isCreator && !isDev && !isOwner && !isMe) return reply(msr.own_cmd)
if (!q) return reply("*Please write the Group Link ποΈ*")
let result = args[0].split('https://chat.whatsapp.com/')[1]
await conn.groupAcceptInvite(result)
await conn.sendMessage(from , { text: `*Successfully Joined β
*`}, { quoted: mek } )
} catch (e) {
await conn.sendMessage(from, { react: { text: 'β', key: mek.key } })
console.log(e)
reply(`β *Error Accurated !!*\n\n${e}`)
}
} )
cmd({
pattern: "tagadmins",
react: "π",
alias: ["admin" ,"admin","tagadmin"],
desc: "To Tag all Admins of the Group",
category: "group",
use: '.tagadmins [message]',
filename: __filename
},
async (conn, mek, m, { from, participants, reply, isGroup, senderNumber, groupAdmins, prefix, command, args, body }) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
const botOwner = conn.user.id.split(":")[0]; // Extract bot owner's number
const senderJid = senderNumber + "@s.whatsapp.net";
// Ensure group metadata is fetched properly
let groupInfo = await conn.groupMetadata(from).catch(() => null);
if (!groupInfo) return reply("β Failed to fetch group information.");
let groupName = groupInfo.subject || "Unknown Group";
let admins = await getGroupAdmins(participants);
let totalAdmins = admins ? admins.length : 0;
if (totalAdmins === 0) return reply("β No admins found in this group.");
let emojis = ['β‘', 'β¨', 'ποΈ', 'π', 'π±', 'π', 'β€βπ©Ή', 'π»', 'π', 'πͺ', 'π', 'πͺΌ', 'πΏ', 'π', 'π', 'π¦', 'π', 'π»', 'πΈ', 'π₯', 'π', 'π§', 'π¨', 'π¦', 'π§', 'πͺ', 'πΎ', 'πͺ', 'π²', 'π‘', 'π§Έ', 'π', 'π', 'π©΅', 'β₯οΈ', 'π©' , 'π³οΈβπ', 'πͺ', 'π', 'π«', 'π', 'π', 'π', 'πͺ»', 'πͺΈ', 'π'];
let randomEmoji = emojis[Math.floor(Math.random() * emojis.length)];
// Proper message extraction
let message = body.slice(body.indexOf(command) + command.length).trim();
if (!message) message = "ATTENTION ADMINS"; // Default message
let teks = `*β’ GROUP : ${groupName}*\n*β’ ADMINS : ${totalAdmins}*\n*β’ MESSAGE: ${message}*\n\nβ*βββββγ ADMINS MENTION γβ*\n`;
for (let admin of admins) {
if (!admin) continue; // Prevent undefined errors
teks += `*β${randomEmoji} α©§πΌΰΎΰ½²* @${admin.split('@')[0]}\n`;
}
// teks += "ββββͺ ALI β MD βͺββ";
conn.sendMessage(from, { text: teks, mentions: admins }, { quoted: mek });
} catch (e) {
console.error("TagAdmins Error:", e);
reply(`β *Error Occurred !!*\n\n${e.message || e}`);
}
});
cmd({
pattern: "invite",
react: "ποΈ",
alias: ["grouplink","glink"],
desc: "To Get the Group Invite link",
category: "group",
use: '.invite',
filename: __filename
},
async(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isCreator ,isDev, isAdmins, reply}) => {
try{
const msr = (await fetchJson('https://raw.githubusercontent.com/JawadYTX/KHAN-DATA/refs/heads/main/MSG/mreply.json')).replyMsg
if (!isGroup) return reply(msr.only_gp)
if (!isAdmins) { if (!isDev) return reply(msr.you_adm),{quoted:mek }}
if (!isBotAdmins) return reply(msr.give_adm)
const code = await conn.groupInviteCode(from)
await conn.sendMessage(from , { text: `*ποΈ Group Link*\n\nhttps://chat.whatsapp.com/${code}`}, { quoted: mek } )
} catch (e) {
await conn.sendMessage(from, { react: { text: 'β', key: mek.key } })
console.log(e)
reply(`β *Error Accurated !!*\n\n${e}`)
}
} )
cmd({
pattern: "revoke",
react: "ποΈ",
alias: ["revokegrouplink","resetglink","revokelink","f_revoke"],
desc: "To Reset the group link",
category: "group",
use: '.revoke',
filename: __filename
},
async(conn, mek, m,{from, l, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isCreator ,isDev, isAdmins, reply}) => {
try{
const msr = (await fetchJson('https://raw.githubusercontent.com/JawadYTX/KHAN-DATA/refs/heads/main/MSG/mreply.json')).replyMsg
if (!isGroup) return reply(msr.only_gp)
if (!isAdmins) { if (!isDev) return reply(msr.you_adm),{quoted:mek }}
if (!isBotAdmins) return reply(msr.give_adm)
await conn.groupRevokeInvite(from)
await conn.sendMessage(from , { text: `*Group link Reseted* β`}, { quoted: mek } )
} catch (e) {
await conn.sendMessage(from, { react: { text: 'β', key: mek.key } })
console.log(e)
reply(`β *Error Accurated !!*\n\n${e}`)
}
} )
cmd({
pattern: "promote",
react: "π₯",
alias: ["addadmin"],
desc: "Promote a user to admin.",
category: "group",
filename: __filename
}, async (conn, mek, m, {
from,
quoted,
isGroup,
isAdmins,
isOwner,
participants,
isBotAdmins,
reply
}) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
if (!isAdmins && !isOwner) return reply("β Only group admins or the owner can use this command.");
if (!isBotAdmins) return reply("β I need admin privileges to promote members.");
// β‘οΈ DΓ©tecter le participant Γ promouvoir (en rΓ©ponse ou mention)
let target;
if (m.quoted) {
target = m.quoted.sender;
} else if (m.mentionedJid && m.mentionedJid.length > 0) {
target = m.mentionedJid[0];
} else if (m.msg && m.msg.contextInfo && m.msg.contextInfo.mentionedJid && m.msg.contextInfo.mentionedJid.length > 0) {
target = m.msg.contextInfo.mentionedJid[0];
}
if (!target) return reply("β Please mention or reply to a user to promote.");
// β‘οΈ VΓ©rifier si l'utilisateur est dΓ©jΓ admin
const isAlreadyAdmin = participants.some(p => p.id === target && p.admin !== null);
if (isAlreadyAdmin) return reply("β User is already an admin.");
// β‘οΈ Promouvoir le participant
await conn.groupParticipantsUpdate(from, [target], "promote")
.catch(err => {
console.error(`β οΈ Failed to promote ${target}:`, err);
return reply("β An error occurred while promoting the participant.");
});
// β‘οΈ Extraire le tag Γ partir du JID
const tag = target.split('@')[0];
reply(`*_@${tag} Promoted Successfully_*`, { mentions: [target] });
} catch (error) {
console.error('Error while executing promote:', error);
reply('β An error occurred while executing the command.');
}
});
cmd({
pattern: "demote",
react: "π₯",
alias: ["removeadmin"],
desc: "Demote a user from admin.",
category: "group",
filename: __filename
}, async (conn, mek, m, {
from,
quoted,
isGroup,
isAdmins,
isOwner,
participants,
isBotAdmins,
reply
}) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
if (!isAdmins && !isOwner) return reply("β Only group admins or the owner can use this command.");
if (!isBotAdmins) return reply("β I need admin privileges to demote members.");
// β‘οΈ DΓ©tecter le participant Γ rΓ©trograder (en rΓ©ponse ou mention)
let target;
if (m.quoted) {
target = m.quoted.sender;
} else if (m.mentionedJid && m.mentionedJid.length > 0) {
target = m.mentionedJid[0];
} else if (m.msg && m.msg.contextInfo && m.msg.contextInfo.mentionedJid && m.msg.contextInfo.mentionedJid.length > 0) {
target = m.msg.contextInfo.mentionedJid[0];
}
if (!target) return reply("β Please mention or reply to a user to demote.");
// β‘οΈ VΓ©rifier si l'utilisateur est bien admin
const isAdmin = participants.some(p => p.id === target && p.admin !== null);
if (!isAdmin) return reply("β User is not an admin.");
// β‘οΈ RΓ©trograder le participant
await conn.groupParticipantsUpdate(from, [target], "demote")
.catch(err => {
console.error(`β οΈ Failed to demote ${target}:`, err);
return reply("β An error occurred while demoting the participant.");
});
// β‘οΈ Extraire le tag Γ partir du JID
const tag = target.split('@')[0];
reply(`*_@${tag} Demoted Successfully_*`, { mentions: [target] });
} catch (error) {
console.error('Error while executing demote:', error);
reply('β An error occurred while executing the command.');
}
});
cmd({
pattern: "taggp",
react: "π",
alias: ["tggp","djtaggp"],
desc: "To Tag all Members for Message",
category: "group",
use: '.tag Hi',
filename: __filename
},
async(conn, mek, m,{from, l, quoted, body, isCmd, command, mentionByTag , args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isCreator ,isDev, isAdmins, reply}) => {
try{
if ( !m.quoted ) return reply('*Please mention a message* βΉοΈ')
if(!q) return reply('*Please add a Group Jid* βΉοΈ')
//if ( q == "120363174739054837@g.us" ) { if ( !isDev ) return reply("β *Acai wage ! You can send Tag messages to Official Support Group*") }
let teks = `${m.quoted.msg}`
conn.sendMessage(q, { text: teks, mentions: participants.map(a => a.id) }, { quoted: mek })
} catch (e) {
await conn.sendMessage(from, { react: { text: 'β', key: mek.key } })
console.log(e)
reply(`β *Error Accurated !!*\n\n${e}`)
}
} )
cmd({
pattern: "gginfo",
desc: "Get group information.",
category: "group",
filename: __filename,
}, async (conn, mek, m, {
from,
isGroup,
isAdmins,
isOwner,
isBotAdmins,
reply
}) => {
try {
// Ensure the command is used in a group
if (!isGroup) return reply("*`[β]`This command can only be used in groups.*");
// Only admins or the owner can use this command
if (!isAdmins && !isOwner) return reply("*`[β]`Only admins and the owner can use this command.*");
// Ensure the bot has admin privileges
if (!isBotAdmins) return reply("*`[β]`I need admin privileges to execute this command.*");
// Get group metadata
const groupMetadata = await conn.groupMetadata(from);
const groupName = groupMetadata.subject;
const memberCount = groupMetadata.participants.length;
// Get group creator
let creator = groupMetadata.owner ? `@${groupMetadata.owner.split('@')[0]}` : 'Unknown';
// Get list of admins
const groupAdmins = groupMetadata.participants
.filter(member => member.admin)
.map((admin, index) => `${index + 1}. @${admin.id.split('@')[0]}`)
.join("\n") || "No admins found";
// Get creation date (convert from timestamp)
const creationDate = groupMetadata.creation
? new Date(groupMetadata.creation * 1000).toLocaleString('en-US', {
weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit'
})
: 'Unknown';
// Format the output message
const message = `
βββββγ *GROUP INFO* γβββββ
β π·οΈ *Ι’Κα΄α΄α΄ Ι΄α΄α΄α΄:* ${groupName}
β π *Ι’Κα΄α΄α΄ Ιͺα΄
:* ${from}
β π₯ *α΄α΄α΄α΄Κ α΄α΄α΄Κα΄Κs:* ${memberCount}
β π¨π»βπ» *α΄Κα΄α΄α΄α΄Κ:* ${creator}
β π
*α΄Κα΄α΄α΄α΄α΄
α΄Ι΄:* ${creationDate}
β π *α΄α΄
α΄ΙͺΙ΄s:*
β ${groupAdmins}
β°βββββββββββββββββββββ`;
// Send the group information with mentions
await conn.sendMessage(from, {
text: message,
mentions: groupMetadata.participants
.filter(member => member.admin)
.map(admin => admin.id)
}, { quoted: mek });
} catch (error) {
console.error("Error in ginfo command:", error);
reply("β An error occurred while retrieving the group information.");
}
});
cmd({
pattern: "tagall",
react: "π",
alias: ["gc_tagall"],
desc: "To Tag all Members",
category: "group",
use: '.tagall [message]',
filename: __filename
},
async (conn, mek, m, { from, participants, reply, isGroup, senderNumber, groupAdmins, prefix, command, args, body }) => {
try {
if (!isGroup) return reply("*π α΄ΚΙͺs α΄α΄α΄α΄α΄Ι΄α΄
α΄α΄Ι΄ α΄Ι΄ΚΚ Κα΄ α΄sα΄α΄
ΙͺΙ΄ Ι’Κα΄α΄α΄s.*");
const botOwner = conn.user.id.split(":")[0]; // Extract bot owner's number
const senderJid = senderNumber + "@s.whatsapp.net";
if (!groupAdmins.includes(senderJid) && senderNumber !== botOwner) {
return reply("*π ΟΙ΄βΚ gΚΟα΄α΄ Ξ±βΠΌΞΉΙ΄s ΟΚ ΡΠ½Ρ ΟΟΙ΄ΡΚ α΄Ξ±Ι΄ α΄sΡ ΡΠ½ΞΉΡ α΄ΟΠΌΠΌΞ±Ι΄β.*");
}
// Ensure group metadata is fetched properly
let groupInfo = await conn.groupMetadata(from).catch(() => null);
if (!groupInfo) return reply("β Failed to fetch group information.");
let groupName = groupInfo.subject || "Unknown Group";
let totalMembers = participants ? participants.length : 0;
if (totalMembers === 0) return reply("β No members found in this group.");
let emojis = ['β‘', 'β¨', 'ποΈ', 'π', 'π±', 'π', 'β€βπ©Ή', 'π»', 'π', 'πͺ', 'π', 'πͺΌ', 'πΏ', 'π', 'π', 'π¦', 'π', 'π»', 'πΈ', 'π₯', 'π', 'π§', 'π¨', 'π¦', 'π§', 'πͺ', 'πΎ', 'πͺ', 'π²', 'π‘', 'π§Έ', 'π', 'π', 'π©΅', 'β₯οΈ', 'π©' , 'π³οΈβπ', 'πͺ', 'π', 'π«', 'π', 'π', 'π', 'πͺ»', 'πͺΈ', 'π'];
let randomEmoji = emojis[Math.floor(Math.random() * emojis.length)];
// Proper message extraction
let message = body.slice(body.indexOf(command) + command.length).trim();
if (!message) message = "ATTENTION EVERYONE"; // Default message
let teks = `*β’ GROUP : ${groupName}*\n*β’ MEMBERS : ${totalMembers}*\n*β’ MESSAGE : ${message}*\n\n*βββγ \`π©α―αͺ³ππππππππαΎαͺ³πͺ\` γββ*\n`;
for (let mem of participants) {
if (!mem.id) continue; // Prevent undefined errors
teks += `*β${randomEmoji} α©§πΌΰΎΰ½²* @${mem.id.split('@')[0]}\n`;
}
conn.sendMessage(from, { text: teks, mentions: participants.map(a => a.id) }, { quoted: mek });
} catch (e) {
console.error("TagAll Error:", e);
reply(`β *Error Occurred !!*\n\n${e.message || e}`);
}
});
cmd({
pattern: "add",
alias: ["aja"],
react: "β",
desc: "Adds a user to the group.",
category: "group",
filename: __filename,
use: '<number>',
},
async (conn, mek, m, { from, args, q, isGroup, senderNumber, botNumber, reply }) => {
try {
if (!isGroup) return reply("*π This command can only be used in groups.*");
// Extract bot owner's number
const botOwner = conn.user.id.split(":")[0];
// Restrict command usage to the bot owner only
if (senderNumber !== botOwner) {
return reply("*π Only the bot owner can use this command.*");
}
// Ensure the bot is an admin
if (!isBotAdmins) return reply("*π I need to be an admin to add users.*");
// Validate user input
if (!q || isNaN(q)) return reply("*π Please provide a valid phone number to add.*");
const userToAdd = `${q}@s.whatsapp.net`;
// Attempt to add the user to the group
let response = await conn.groupParticipantsUpdate(from, [userToAdd], "add");
// Check if the user was successfully added
if (response[0].status === 200) {
reply(`β
User *${q}* has been added to the group.`);
} else {
reply("β Failed to add user. Make sure the number is correct and they are not already in the group.");
}
} catch (e) {
console.error("Error adding user:", e);
reply("β An error occurred while adding the user. Please try again.");
}
});
cmd({
pattern: "updategdesc",
alias: ["upgdesc", "gdesc"],
react: "π",
desc: "Change the group description.",
category: "group",
filename: __filename
},
async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, args, q, reply }) => {
try {
if (!isGroup) return reply("*π This command can only be used in groups.*");
if (!isAdmins) return reply("*β Only group admins can use this command.*");
if (!isBotAdmins) return reply("β I need to be an admin to update the group description.");
if (!q) return reply("*β Please provide a new group description.*");
await conn.groupUpdateDescription(from, q);
reply("*β
Group description has been updated.*");
} catch (e) {
console.error("Error updating group description:", e);
reply("β Failed to update the group description. Please try again.");
}
});
cmd({
pattern: "updategname",
alias: ["upgname", "gname"],
react: "π",
desc: "Change the group name.",
category: "group",
filename: __filename
},
async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, args, q, reply }) => {
try {
if (!isGroup) return reply("*π This command can only be used in groups.*");
if (!isAdmins) return reply("β Only group admins can use this command.");
if (!isBotAdmins) return reply("*π I need to be an admin to update the group name.*");
if (!q) return reply("*βοΈ Please provide a new group name.*");
await conn.groupUpdateSubject(from, q);
reply(`β
Group name has been updated to: *${q}*`);
} catch (e) {
console.error("Error updating group name:", e);
reply("β Failed to update the group name. Please try again.");
}
});
cmd({
pattern: "lockgc",
alias: ["lock"],
react: "π",
desc: "Lock the group (Prevents new members from joining).",
category: "group",
filename: __filename
},
async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, reply }) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
if (!isAdmins) return reply("*π Only group admins can use this command.*");
if (!isBotAdmins) return reply("*π I need to be an admin to lock the group.*");
await conn.groupSettingUpdate(from, "locked");
reply("*β
Group has been locked. New members cannot join.*");
} catch (e) {
console.error("Error locking group:", e);
reply("β Failed to lock the group. Please try again.");
}
});
cmd({
pattern: "mute",
alias: ["groupmute"],
react: "π",
desc: "Mute the group (Only admins can send messages).",
category: "group",
filename: __filename
},
async (conn, mek, m, { from, isGroup, senderNumber, isAdmins, isBotAdmins, reply }) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
if (!isAdmins) return reply("*π α΄Ι΄ΚΚ Ι’Κα΄α΄α΄ α΄α΄
α΄ΙͺΙ΄s α΄α΄Ι΄ α΄sα΄ α΄ΚΙͺs α΄α΄α΄α΄α΄Ι΄α΄
.*");
if (!isBotAdmins) return reply("*π Ι΄α΄α΄α΄
α΄α΄ Κα΄ α΄Ι΄ α΄α΄
α΄ΙͺΙ΄ α΄α΄ α΄Ι΄α΄α΄α΄α΄ α΄Κα΄ Ι’Κα΄α΄α΄*");
await conn.groupSettingUpdate(from, "announcement");
reply("*gΚΟα΄Ο ΠΌα΄ΡΡβ sα΄α΄α΄ΡΡΡfα΄ββΡπ*");
} catch (e) {
console.error("Error muting group:", e);
reply("β Failed to mute the group. Please try again.");
}
});
cmd({
pattern: "unmute",
alias: ["groupunmute"],
react: "π",
desc: "Unmute the group (Everyone can send messages).",
category: "group",
filename: __filename
},
async (conn, mek, m, { from, isGroup, senderNumber, isAdmins, isBotAdmins, reply }) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
if (!isAdmins) return reply("*π α΄Ι΄ΚΚ Ι’Κα΄α΄α΄ α΄α΄
α΄ΙͺΙ΄s α΄α΄Ι΄ α΄sα΄ α΄ΚΙͺs α΄α΄α΄α΄α΄Ι΄α΄
.*");
if (!isBotAdmins) return reply("*π Ι΄α΄α΄α΄
α΄α΄ Κα΄ α΄Ι΄ α΄α΄
α΄ΙͺΙ΄ α΄α΄ α΄Ι΄α΄α΄α΄α΄ α΄Κα΄ Ι’Κα΄α΄α΄*");
await conn.groupSettingUpdate(from, "not_announcement");
reply("*gΚΟα΄Ο α΄Ι΄ΠΌΟ
ΡΡβ sα΄α΄α΄ΡΡΡfα΄ββΡπ*");
} catch (e) {
console.error("Error unmuting group:", e);
reply("β Failed to unmute the group. Please try again.");
}
});
cmd({
pattern: "unlockgc",
alias: ["unlock"],
react: "π",
desc: "Unlock the group (Allows new members to join).",
category: "group",
filename: __filename
},
async (conn, mek, m, { from, isGroup, isAdmins, isBotAdmins, reply }) => {
try {
if (!isGroup) return reply("β This command can only be used in groups.");
if (!isAdmins) return reply("*π Only group admins can use this command.*");
if (!isBotAdmins) return reply("*π I need to be an admin to unlock the group.*");
await conn.groupSettingUpdate(from, "unlocked");
reply("β
Group has been unlocked. New members can now join.");
} catch (e) {
console.error("Error unlocking group:", e);
reply("β Failed to unlock the group. Please try again.");
}
});
|