Skip to content

Commit 3ca0f20

Browse files
committed
feat(#113): anti tag sw
1 parent 5a16869 commit 3ca0f20

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

β€Žlib/system/models.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const models = {
1818
antidelete: true,
1919
antilink: false,
2020
antivirtex: false,
21+
antitagsw: true,
2122
filter: false,
2223
left: false,
2324
localonly: false,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
exports.run = {
2+
async: async (m, {
3+
client,
4+
groupSet,
5+
isAdmin,
6+
Func
7+
}) => {
8+
try {
9+
if (groupSet.antitagsw && !isAdmin && /groupStatusMentionMessage/.test(m.mtype)) return client.groupParticipantsUpdate(m.chat, [m.sender], 'remove').then(() => client.sendMessage(m.chat, {
10+
delete: {
11+
remoteJid: m.chat,
12+
fromMe: false,
13+
id: m.key.id,
14+
participant: m.sender
15+
}
16+
}))
17+
} catch (e) {
18+
return client.reply(m.chat, Func.jsonFormat(e), m)
19+
}
20+
},
21+
error: false,
22+
group: true,
23+
botAdmin: true,
24+
cache: true,
25+
location: __filename
26+
}

β€Žplugins/admin/moderation.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
exports.run = {
2-
usage: ['antidelete', 'antilink', 'antivirtex', 'autosticker', 'viewonce', 'left', 'filter', 'localonly', 'welcome'],
2+
usage: ['antidelete', 'antilink', 'antivirtex', 'antitagsw', 'autosticker', 'viewonce', 'left', 'filter', 'localonly', 'welcome'],
33
use: 'on / off',
44
category: 'admin tools',
55
async: async (m, {
@@ -13,7 +13,7 @@ exports.run = {
1313
try {
1414
let setting = global.db.groups.find(v => v.jid == m.chat)
1515
let type = command.toLowerCase()
16-
if (!isBotAdmin && /antilink|antivirtex|filter|localonly/.test(type)) return client.reply(m.chat, global.status.botAdmin, m)
16+
if (!isBotAdmin && /antilink|antivirtex|filter|localonly|antitagsw/.test(type)) return client.reply(m.chat, global.status.botAdmin, m)
1717
if (!args || !args[0]) return client.reply(m.chat, `🚩 *Current status* : [ ${setting[type] ? 'ON' : 'OFF'} ] (Enter *On* or *Off*)`, m)
1818
let option = args[0].toLowerCase()
1919
let optionList = ['on', 'off']

β€Žplugins/group/groupinfo.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ exports.run = {
2727
caption += ` β—¦ ${Func.switcher(setting.antilink, '[ √ ]', '[ Γ— ]')} Anti Link\n`
2828
caption += ` β—¦ ${Func.switcher(setting.antivirtex, '[ √ ]', '[ Γ— ]')} Anti Virtex\n`
2929
caption += ` β—¦ ${Func.switcher(setting.filter, '[ √ ]', '[ Γ— ]')} Filter\n`
30+
caption += ` β—¦ ${Func.switcher(setting.antitagsw, '[ √ ]', '[ Γ— ]')} Anti Story Tag\n`
3031
caption += ` β—¦ ${Func.switcher(setting.autosticker, '[ √ ]', '[ Γ— ]')} Auto Sticker\n`
3132
caption += ` β—¦ ${Func.switcher(setting.left, '[ √ ]', '[ Γ— ]')} Left Message\n`
3233
caption += ` β—¦ ${Func.switcher(setting.localonly, '[ √ ]', '[ Γ— ]')} Localonly\n`

0 commit comments

Comments
Β (0)