File size: 5,530 Bytes
8d8b0ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
const {
  cmd
} = require('../command');
const sleep = _0x28b89a => new Promise(_0x3ad2ff => setTimeout(_0x3ad2ff, _0x28b89a));
cmd({
  'pattern': 'removemembers',
  'alias': ["kickall", 'endgc', "endgroup"],
  'desc': "Remove all non-admin members from the group.",
  'react': 'πŸŽ‰',
  'category': "group",
  'filename': __filename
}, async (_0x541c7c, _0x28ecd0, _0x2ebb28, {
  from: _0x3ec016,
  groupMetadata: _0x561a47,
  groupAdmins: _0x4abe0f,
  isBotAdmins: _0x119769,
  senderNumber: _0x112bfc,
  reply: _0x1cd54a,
  isGroup: _0x2d9dc6
}) => {
  try {
    if (!_0x2d9dc6) {
      return _0x1cd54a("This command can only be used in groups.");
    }
    const _0x5ad0e2 = _0x541c7c.user.id.split(':')[0x0];
    if (_0x112bfc !== _0x5ad0e2) {
      return _0x1cd54a("Only the bot owner can use this command.");
    }
    if (!_0x119769) {
      return _0x1cd54a("I need to be an admin to execute this command.");
    }
    const _0x27054b = _0x561a47.participants;
    const _0x59ce1d = _0x27054b.filter(_0x31bd1b => !_0x4abe0f.includes(_0x31bd1b.id));
    if (_0x59ce1d.length === 0x0) {
      return _0x1cd54a("There are no non-admin members to remove.");
    }
    _0x1cd54a("Starting to remove " + _0x59ce1d.length + " non-admin members...");
    for (let _0x58a736 of _0x59ce1d) {
      try {
        await _0x541c7c.groupParticipantsUpdate(_0x3ec016, [_0x58a736.id], 'remove');
        await sleep(0x7d0);
      } catch (_0x448767) {
        console.error("Failed to remove " + _0x58a736.id + ':', _0x448767);
      }
    }
    _0x1cd54a("Successfully removed all non-admin members from the group.");
  } catch (_0x2ffa0d) {
    console.error("Error removing non-admin users:", _0x2ffa0d);
    _0x1cd54a("An error occurred while trying to remove non-admin members. Please try again.");
  }
});
cmd({
  'pattern': "removeadmins",
  'alias': ["kickadmins", "kickall3", "deladmins"],
  'desc': "Remove all admin members from the group, excluding the bot and bot owner.",
  'react': 'πŸŽ‰',
  'category': "group",
  'filename': __filename
}, async (_0x2c9a95, _0x3d19b1, _0x5d9806, {
  from: _0x49bf85,
  isGroup: _0x437d8e,
  senderNumber: _0x39ac26,
  groupMetadata: _0x45af2,
  groupAdmins: _0x59d911,
  isBotAdmins: _0x25f378,
  reply: _0x454a95
}) => {
  try {
    if (!_0x437d8e) {
      return _0x454a95("This command can only be used in groups.");
    }
    const _0x86850b = _0x2c9a95.user.id.split(':')[0x0];
    if (_0x39ac26 !== _0x86850b) {
      return _0x454a95("Only the bot owner can use this command.");
    }
    if (!_0x25f378) {
      return _0x454a95("I need to be an admin to execute this command.");
    }
    const _0x5251dc = _0x45af2.participants;
    const _0x3468fe = _0x5251dc.filter(_0x6832c1 => _0x59d911.includes(_0x6832c1.id) && _0x6832c1.id !== _0x2c9a95.user.id && _0x6832c1.id !== _0x86850b + "@s.whatsapp.net");
    if (_0x3468fe.length === 0x0) {
      return _0x454a95("There are no admin members to remove.");
    }
    _0x454a95("Starting to remove " + _0x3468fe.length + " admin members, excluding the bot and bot owner...");
    for (let _0x164699 of _0x3468fe) {
      try {
        await _0x2c9a95.groupParticipantsUpdate(_0x49bf85, [_0x164699.id], 'remove');
        await sleep(0x7d0);
      } catch (_0x1b4051) {
        console.error("Failed to remove " + _0x164699.id + ':', _0x1b4051);
      }
    }
    _0x454a95("Successfully removed all admin members from the group, excluding the bot and bot owner.");
  } catch (_0x2a5e6b) {
    console.error("Error removing admins:", _0x2a5e6b);
    _0x454a95("An error occurred while trying to remove admins. Please try again.");
  }
});
cmd({
  'pattern': "removeall2",
  'alias': ["kickall2", "endgc2", "endgroup2"],
  'desc': "Remove all members and admins from the group, excluding the bot and bot owner.",
  'react': 'πŸŽ‰',
  'category': "group",
  'filename': __filename
}, async (_0x58df9b, _0x205354, _0x4f7c7c, {
  from: _0xc8fca7,
  isGroup: _0x4daea3,
  senderNumber: _0x270b3f,
  groupMetadata: _0x5289f6,
  isBotAdmins: _0x1db97d,
  reply: _0x477905
}) => {
  try {
    if (!_0x4daea3) {
      return _0x477905("This command can only be used in groups.");
    }
    const _0x3fdab4 = _0x58df9b.user.id.split(':')[0x0];
    if (_0x270b3f !== _0x3fdab4) {
      return _0x477905("Only the bot owner can use this command.");
    }
    if (!_0x1db97d) {
      return _0x477905("I need to be an admin to execute this command.");
    }
    const _0x44e3d7 = _0x5289f6.participants;
    if (_0x44e3d7.length === 0x0) {
      return _0x477905("The group has no members to remove.");
    }
    const _0x94c1ea = _0x44e3d7.filter(_0x29a3c7 => _0x29a3c7.id !== _0x58df9b.user.id && _0x29a3c7.id !== _0x3fdab4 + "@s.whatsapp.net");
    if (_0x94c1ea.length === 0x0) {
      return _0x477905("No members to remove after excluding the bot and bot owner.");
    }
    _0x477905("Starting to remove " + _0x94c1ea.length + " members, excluding the bot and bot owner...");
    for (let _0x447569 of _0x94c1ea) {
      try {
        await _0x58df9b.groupParticipantsUpdate(_0xc8fca7, [_0x447569.id], "remove");
        await sleep(0x7d0);
      } catch (_0x2fc4ea) {
        console.error("Failed to remove " + _0x447569.id + ':', _0x2fc4ea);
      }
    }
    _0x477905("Successfully removed all members, excluding the bot and bot owner, from the group.");
  } catch (_0x191e55) {
    console.error("Error removing members:", _0x191e55);
    _0x477905("An error occurred while trying to remove members. Please try again.");
  }
});