config-on y off.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. import fetch from 'node-fetch'
  2. import fs from 'fs'
  3. let handler = async (m, { conn, usedPrefix, command, args, isOwner, isAdmin, isROwner, text }) => {
  4. //try{
  5. let chat = global.db.data.chats[m.chat]
  6. let user = global.db.data.users[m.sender]
  7. let bot = global.db.data.settings[conn.user.jid] || {}
  8. let toUser = `${m.sender.split("@")[0]}`
  9. let aa = toUser + '@s.whatsapp.net'
  10. let listSections = []
  11. listSections.push({ title: '『 FUNCIÓN PARA ADMINS 』',
  12. rows: [{ header: `🎉 BIENVENIDA ${m.isGroup ? chat.welcome ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} welcome`, description: `Mensaje de Bienvenida para nuevos Miembros en Grupos\n` },
  13. { header: `🔗 ANTI ENLACES ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antilink`, description: `Eliminar Personas que envíen enlaces de Grupos de WhatsApp\n` },
  14. { header: `🔗 ANTI ENLACES 2 ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antilink2`, description: `Eliminar Personas que envíen enlaces que contengan https\n` },
  15. { header: `🔗 ANTI TRABA ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antitraba`, description: `El Bot detecta textos largos que podrian ser virus y causar lag en el chat y elimina al usuario.\n` },
  16. { header: `🔗 ANTI TIKTOK ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antitiktok`, description: `Eliminar Personas que envíen enlaces de TikTok\n` },
  17. { header: `🔗 ANTI YOUTUBE ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antiyoutube`, description: `Eliminar Personas que envíen enlaces de YouTube\n` },
  18. { header: `🔗 ANTI TELEGRAM ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antitelegram`, description: `Eliminar Personas que envíen enlaces de Telegram\n` },
  19. { header: `🔗 ANTI FACEBOOK ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antifacebook`, description: `Eliminar Personas que envíen enlaces de Facebbok\n` },
  20. { header: `🔗 ANTI INSTAGRAM ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antiinstagram`, description: `Eliminar Personas que envíen enlaces de Instagram\n` },
  21. { header: `🔗 ANTI TWITTER ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antitwitter`, description: `Eliminar Personas que envíen enlaces de Twitter\n` },
  22. { header: `🔗 ANTI DISCORD ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antidiscord`, description: `Eliminar Personas que envíen enlaces de Discord\n` },
  23. { header: `🔗 ANTI TREADS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antithreads`, description: `Eliminar Personas que envíen enlaces de Threas\n` },
  24. { header: `🟢 ANTIFAKE ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antifake`, description: `ᶦⁿᵍʳᵉˢᵒ ᵈᵉ ⁿᵘᵐᵉʳᵒ ᶠᵃᵏᵉ (ᵛᶦʳᵗᵘᵃˡᵉˢ), ˢᵉʳᵃⁿ ᵉˣᵖˡᵘˢᵃᵈᵒ ᵃᵘᵗᵒᵐᵃ́ᵗᶦᶜᵃᵐᵉⁿᵗᵉ ᵈᵉˡ ᴳʳᵘᵖᵒ...\n` },
  25. { header: `🔔 AVISOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} detect`, description: `Avisos de acciones dentro del Grupo\n` },
  26. { header: `🪄 STICKERS AUTOMÁTICOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} autosticker`, description: `Los vídeos, Gif, imágenes, enlaces jpg o jpeg; Se convertirán en Stickers Automáticamente\n` },
  27. { header: `🗑️ ANTI ELIMINAR ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} antidelete`, description: `Todo mensaje eliminado será reenviado al Chat o Grupo\n` },
  28. { header: `🔞 MODO CALIENTE ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} modohorny`, description: `Mostrar contenido para Adulto en los Chats\n` },
  29. { header: `🔊 AUDIOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} audios`, description: `Habilitar el envio automático de Audios a todos\n` },
  30. { header: `🆙 NIVEL AUTOMÁTICO ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} autolevelup`, description: `Sube de nivel a todos de manera automática; (Aplica recompensas por subir de Nivel)\n` },
  31. { header: `🙃 CHATBOT ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} chatbot`, description: `El bot empezar a hablar con todos el grupo.\n` },
  32. { header: `🛂 MODO ADMIN ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `.${usedPrefix + command} modoadmin`, description: `Solo los Admins podrán usar el Bot en Grupos\n` },
  33. { header: `『 FUNCIÓN SOLO PARA OWNER 』\n`, title: `🔰 ANTI PRIVADO ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, id: `${usedPrefix + command} antiprivado`, description: `Bloquea a la persoma que usen el bot en privado\n` },
  34. { header: `🚫 ANTI LLAMADAS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} anticall`, description: `Bloquea a Personas que hagan llamadas\n` },
  35. { header: `⛔ RESTRINGIR ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} restrict`, description: `Habilitar función para agregar o eliminar personas en Grupos\n` },
  36. { header: `⚜️ SOLO PRIVADOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} pconly`, description: `Permitir que solo se use en Chats Privados\n` },
  37. { header: `⚜️ SOLO GRUPOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} gconly`, description: `Permitir que solo se use en Chats Grupales\n` },
  38. { header: `✅ LECTURA AUTOMÁTICA ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} autoread`, description: `Dejar los mensajes o chats como Leídos.\n` },
  39. { header: `🌐 MODO PÚBLICO ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}`, title: "", id: `${usedPrefix + command} public`, description: `Habilitar función para que todos puedan usar KantuBot.\n` }]
  40. });
  41. let textoo = `*\`⧼⧼⧼ CONFIGURACIÓN ⧽⧽⧽\`*
  42. > *Seleccione una opción de la lista*
  43. > *Para empezar a Configurar*
  44. ● *Avisos de la Configuracion:*
  45. ✅ ⇢ *Función Activada*
  46. ❌ ⇢ *Función Desactivada*
  47. ⚠️ ⇢ *Este Chat no es un Grupo*
  48. *\`『 FUNCIÓN PARA ADMINS 』\`*
  49. 🎉 BIENVENIDA ${m.isGroup ? chat.welcome ? '✅' : '❌' : `⚠️`}
  50. • Mensaje de Bienvenida para nuevos Miembros en Grupos
  51. • ${usedPrefix + command} welcome
  52. 🔗 ANTI ENLACES ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  53. • Eliminar Personas que envíen enlaces de Grupos de WhatsApp
  54. • ${usedPrefix + command} antilink
  55. 🔗 ANTI ENLACES 2 ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  56. • Eliminar Personas que envíen enlaces que contengan https
  57. • ${usedPrefix + command} antilink2
  58. 🔗 ANTI TRABA ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  59. • El Bot detecta textos largos que podrían ser virus y causar lag en el chat y elimina al usuario.
  60. • ${usedPrefix + command} antitraba
  61. 🔗 ANTI TIKTOK ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  62. • Eliminar Personas que envíen enlaces de TikTok
  63. • ${usedPrefix + command} antitiktok
  64. 🔗 ANTI YOUTUBE ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  65. • Eliminar Personas que envíen enlaces de YouTube
  66. • ${usedPrefix + command} antiyoutube
  67. 🔗 ANTI TELEGRAM ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  68. • Eliminar Personas que envíen enlaces de Telegram
  69. • ${usedPrefix + command} antitelegram
  70. 🔗 ANTI FACEBOOK ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  71. • Eliminar Personas que envíen enlaces de Facebook
  72. • ${usedPrefix + command} antifacebook
  73. 🔗 ANTI INSTAGRAM ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  74. • Eliminar Personas que envíen enlaces de Instagram
  75. • ${usedPrefix + command} antiinstagram
  76. 🔗 ANTI TWITTER ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  77. • Eliminar Personas que envíen enlaces de Twitter
  78. • ${usedPrefix + command} antitwitter
  79. 🔗 ANTI DISCORD ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  80. • Eliminar Personas que envíen enlaces de Discord
  81. • ${usedPrefix + command} antidiscord
  82. 🔗 ANTI THREADS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  83. • Eliminar Personas que envíen enlaces de Threads
  84. • ${usedPrefix + command} antithreads
  85. 🟢 ANTIFAKE ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  86. • Ingreso de número fake (virtuales), serán expulsados automáticamente del Grupo.
  87. • ${usedPrefix + command} antifake
  88. 🔔 AVISOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  89. • Avisos de acciones dentro del Grupo
  90. • ${usedPrefix + command} detect
  91. 🪄 STICKERS AUTOMÁTICOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  92. • Los vídeos, GIF, imágenes, enlaces jpg o jpeg; se convertirán en Stickers automáticamente.
  93. • ${usedPrefix + command} autosticker
  94. 🗑️ ANTI ELIMINAR ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  95. • Todo mensaje eliminado será reenviado al Chat o Grupo.
  96. • ${usedPrefix + command} antidelete
  97. 🔞 MODO CALIENTE ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  98. • Mostrar contenido para Adultos en los Chats.
  99. • ${usedPrefix + command} modohorny
  100. 🔊 AUDIOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  101. • Habilitar el envío automático de Audios a todos.
  102. • ${usedPrefix + command} audios
  103. 🆙 NIVEL AUTOMÁTICO ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  104. • Sube de nivel a todos de manera automática; (Aplica recompensas por subir de nivel).
  105. • ${usedPrefix + command} autolevelup
  106. 🙃 CHATBOT ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  107. • El bot comenzará a hablar con todos en el grupo.
  108. • ${usedPrefix + command} chatbot
  109. 🛂 MODO ADMIN ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  110. • Solo los Admins podrán usar el Bot en Grupos.
  111. • ${usedPrefix + command} modoadmin
  112. *\`『 FUNCIÓN SOLO PARA OWNER 』\`"
  113. 🔰 ANTI PRIVADO ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  114. • Bloquea a las personas que usen el bot en privado.
  115. • ${usedPrefix + command} antiprivado
  116. 🚫 ANTI LLAMADAS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  117. • Bloquea a personas que hagan llamadas.
  118. • ${usedPrefix + command} anticall
  119. ⛔ RESTRINGIR ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  120. • Habilitar función para agregar o eliminar personas en Grupos.
  121. • ${usedPrefix + command} restrict
  122. ⚜️ SOLO PRIVADOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  123. • Permitir que solo se use en Chats Privados.
  124. • ${usedPrefix + command} pconly
  125. ⚜️ SOLO GRUPOS ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  126. • Permitir que solo se use en Chats Grupales.
  127. • ${usedPrefix + command} gconly
  128. ✅ LECTURA AUTOMÁTICA ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  129. • Dejar los mensajes o chats como Leídos.
  130. • ${usedPrefix + command} autoread
  131. 🌐 MODO PÚBLICO ${m.isGroup ? chat.antilink ? '✅' : '❌' : `⚠️`}
  132. • Habilitar función para que todos puedan usar el bot.
  133. • ${usedPrefix + command} public
  134. > ${wm}`
  135. let isEnable = /true|enable|(turn)?on|1/i.test(command)
  136. let type = (args[0] || '').toLowerCase()
  137. let isAll = false, isUser = false
  138. switch (type) {
  139. case 'welcome': case 'bienvenida':
  140. if (!m.isGroup) {
  141. if (!isOwner) {
  142. global.dfail('group', m, conn)
  143. throw false
  144. }
  145. } else if (!isAdmin) {
  146. global.dfail('admin', m, conn)
  147. throw false
  148. }
  149. chat.welcome = isEnable
  150. break
  151. case 'detect': case 'avisos':
  152. if (!m.isGroup) {
  153. if (!isOwner) {
  154. global.dfail('group', m, conn)
  155. throw false
  156. }
  157. } else if (!isAdmin) {
  158. global.dfail('admin', m, conn)
  159. throw false
  160. }
  161. chat.detect = isEnable
  162. break
  163. case 'antidelete': case 'antieliminar': case 'delete':
  164. if (m.isGroup) {
  165. if (!(isAdmin || isOwner)) {
  166. global.dfail('admin', m, conn)
  167. throw false
  168. }}
  169. chat.delete = isEnable
  170. break
  171. case 'public': case 'publico':
  172. isAll = true
  173. if (!isROwner) {
  174. global.dfail('rowner', m, conn)
  175. throw false
  176. }
  177. global.opts['self'] = !isEnable
  178. break
  179. case 'antilink': case 'antienlace':
  180. if (m.isGroup) {
  181. if (!(isAdmin || isOwner)) {
  182. global.dfail('admin', m, conn)
  183. throw false
  184. }}
  185. chat.antiLink = isEnable
  186. break
  187. case 'antilink2': case 'antienlace2':
  188. if (m.isGroup) {
  189. if (!(isAdmin || isOwner)) {
  190. global.dfail('admin', m, conn)
  191. throw false
  192. }}
  193. chat.antiLink2 = isEnable
  194. break
  195. case 'antitiktok': case 'antitk': case 'antitik':
  196. if (m.isGroup) {
  197. if (!(isAdmin || isOwner)) {
  198. global.dfail('admin', m, conn)
  199. throw false
  200. }}
  201. chat.antiTiktok = isEnable
  202. break
  203. case 'antiyoutube': case 'antiyt':
  204. if (m.isGroup) {
  205. if (!(isAdmin || isOwner)) {
  206. global.dfail('admin', m, conn)
  207. throw false
  208. }}
  209. chat.antiYoutube = isEnable
  210. break
  211. case 'antitelegram': case 'antitl': case 'antitele': case 'antitg': case 'antitel':
  212. if (m.isGroup) {
  213. if (!(isAdmin || isOwner)) {
  214. global.dfail('admin', m, conn)
  215. throw false
  216. }}
  217. chat.antiTelegram = isEnable
  218. break
  219. case 'antifacebook': case 'antifb': case 'antifbook':
  220. if (m.isGroup) {
  221. if (!(isAdmin || isOwner)) {
  222. global.dfail('admin', m, conn)
  223. throw false
  224. }}
  225. chat.antiFacebook = isEnable
  226. break
  227. case 'antiinstagram': case 'antinstagram': case 'antiig': case 'antig': case 'antiinsta': case 'antinsta':
  228. if (m.isGroup) {
  229. if (!(isAdmin || isOwner)) {
  230. global.dfail('admin', m, conn)
  231. throw false
  232. }}
  233. chat.antiInstagram = isEnable
  234. break
  235. case 'antitwitter': case 'antitw': case 'antitwit': case 'antitwter': case 'antitwiter': case 'antix':
  236. if (m.isGroup) {
  237. if (!(isAdmin || isOwner)) {
  238. global.dfail('admin', m, conn)
  239. throw false
  240. }}
  241. chat.antiTwitter = isEnable
  242. break
  243. case 'antidiscord':
  244. if (m.isGroup) {
  245. if (!(isAdmin || isOwner)) {
  246. global.dfail('admin', m, conn)
  247. throw false
  248. }}
  249. chat.antiDiscord = isEnable
  250. break
  251. case 'antithreads':
  252. if (m.isGroup) {
  253. if (!(isAdmin || isOwner)) {
  254. global.dfail('admin', m, conn)
  255. throw false
  256. }}
  257. chat.antiThreads = isEnable
  258. break
  259. case 'antitwitch':
  260. if (m.isGroup) {
  261. if (!(isAdmin || isOwner)) {
  262. global.dfail('admin', m, conn)
  263. throw false
  264. }}
  265. chat.antiTwitch = isEnable
  266. break
  267. case 'modohorny': case 'modocaliente': case 'modehorny':
  268. if (m.isGroup) {
  269. if (!(isAdmin || isOwner)) {
  270. global.dfail('admin', m, conn)
  271. throw false
  272. }}
  273. chat.modohorny = isEnable
  274. break
  275. case 'stickers':
  276. if (m.isGroup) {
  277. if (!(isAdmin || isOwner)) {
  278. global.dfail('admin', m, conn)
  279. throw false
  280. }}
  281. chat.stickers = isEnable
  282. break
  283. case 'game': case 'juegos': case 'fun':
  284. if (m.isGroup) {
  285. if (!(isAdmin || isOwner)) {
  286. global.dfail('admin', m, conn)
  287. throw false
  288. }}
  289. chat.game = isEnable
  290. break
  291. case 'ruleta': case 'game2':
  292. if (m.isGroup) {
  293. if (!(isAdmin || isOwner)) {
  294. global.dfail('admin', m, conn)
  295. throw false
  296. }}
  297. chat.game2 = isEnable
  298. break
  299. case 'temporal':
  300. isAll = true
  301. if (!isOwner) {
  302. global.dfail('owner', m, conn)
  303. throw false
  304. }
  305. bot.temporal = isEnable
  306. break
  307. case 'autolevelup': case 'autonivel': case 'nivelautomatico':
  308. if (m.isGroup) {
  309. if (!(isAdmin || isOwner)) {
  310. global.dfail('admin', m, conn)
  311. throw false
  312. }}
  313. chat.autolevelup = isEnable
  314. break
  315. case 'autosticker':
  316. if (m.isGroup) {
  317. if (!(isAdmin || isOwner)) {
  318. global.dfail('admin', m, conn)
  319. throw false
  320. }}
  321. chat.autosticker = isEnable
  322. break
  323. case 'reaction': case 'reaccion': case 'emojis': case 'antiemojis': case 'reacciones': case 'reaciones':
  324. if (m.isGroup) {
  325. if (!(isAdmin || isOwner)) {
  326. global.dfail('admin', m, conn)
  327. throw false
  328. }}
  329. chat.reaction = isEnable
  330. break
  331. case 'antitoxic': case 'antitoxicos': case 'antimalos':
  332. if (m.isGroup) {
  333. if (!(isAdmin || isOwner)) {
  334. global.dfail('admin', m, conn)
  335. throw false
  336. }}
  337. chat.antitoxic = isEnable
  338. break
  339. case 'audios':
  340. if (m.isGroup) {
  341. if (!(isAdmin || isOwner)) {
  342. global.dfail('admin', m, conn)
  343. throw false
  344. }}
  345. chat.audios = isEnable
  346. break
  347. case 'antiver': case 'modover': case 'modoobservar': case 'modobservar': case 'antiviewonce':
  348. if (m.isGroup) {
  349. if (!(isAdmin || isOwner)) {
  350. global.dfail('admin', m, conn)
  351. throw false
  352. }}
  353. chat.antiver = isEnable
  354. break
  355. case 'antiinternacional': case 'antinternacional': case 'antinternational': case 'antifake': case 'antifalsos': case 'antivirtuales': case 'antiextranjeros':
  356. if (m.isGroup) {
  357. if (!(isAdmin || isOwner)) {
  358. global.dfail('admin', m, conn)
  359. throw false
  360. }}
  361. chat.antifake = isEnable
  362. break
  363. case 'jadibot': case 'modojadibot': case 'serbot': case 'modoserbot':
  364. isAll = true
  365. if (!isROwner) {
  366. global.dfail('rowner', m, conn)
  367. throw false
  368. }
  369. bot.jadibotmd = isEnable
  370. break
  371. case 'restrict': case 'restringir':
  372. isAll = true
  373. if (!isOwner) {
  374. global.dfail('owner', m, conn)
  375. throw false
  376. }
  377. bot.restrict = isEnable
  378. break
  379. case 'antiporn': case 'antiporno':
  380. if (m.isGroup) {
  381. if (!(isAdmin || isOwner)) {
  382. global.dfail('admin', m, conn)
  383. throw false
  384. }}
  385. chat.antiPorn = isEnable
  386. break
  387. case 'nyimak':
  388. isAll = true
  389. if (!isROwner) {
  390. global.dfail('rowner', m, conn)
  391. throw false
  392. }
  393. global.opts['nyimak'] = isEnable
  394. break
  395. case 'autoread': case 'autovisto':
  396. isAll = true
  397. if (!isROwner) {
  398. global.dfail('rowner', m, conn)
  399. throw false
  400. }
  401. bot.autoread2 = isEnable
  402. global.opts['autoread'] = isEnable
  403. break
  404. case 'anticall': case 'antillamar':
  405. isAll = true
  406. if (!isOwner) {
  407. global.dfail('rowner', m, conn)
  408. throw false
  409. }
  410. bot.antiCall = isEnable
  411. break
  412. case 'antispam':
  413. isAll = true
  414. if (!isOwner) {
  415. global.dfail('owner', m, conn)
  416. throw false
  417. }
  418. bot.antiSpam = isEnable
  419. break
  420. case 'antispam2':
  421. isAll = true
  422. if (!isOwner) {
  423. global.dfail('owner', m, conn)
  424. throw false
  425. }
  426. bot.antiSpam2 = isEnable
  427. break
  428. case 'modoadmin': case 'soloadmin': case 'modeadmin':
  429. if (m.isGroup) {
  430. if (!(isAdmin || isOwner)) {
  431. global.dfail('admin', m, conn)
  432. throw false
  433. }}
  434. chat.modoadmin = isEnable
  435. break
  436. case 'pconly': case 'privateonly': case 'soloprivados':
  437. isAll = true
  438. if (!isOwner) {
  439. global.dfail('rowner', m, conn)
  440. throw false
  441. }
  442. global.opts['pconly'] = isEnable
  443. break
  444. case 'gconly': case 'grouponly': case 'sologrupos':
  445. isAll = true
  446. if (!isOwner) {
  447. global.dfail('rowner', m, conn)
  448. throw false
  449. }
  450. global.opts['gconly'] = isEnable
  451. break
  452. case 'antiprivado': case 'antiprivate':
  453. case 'privado':
  454. isAll = true
  455. if (!isOwner) {
  456. global.dfail('rowner', m, conn)
  457. throw false
  458. }
  459. bot.antiPrivate = isEnable
  460. break
  461. case 'antitrabas': case 'antitraba': case 'antilag':
  462. if (m.isGroup) {
  463. if (!(isAdmin || isOwner)) {
  464. global.dfail('admin', m, conn)
  465. throw false
  466. }}
  467. chat.antiTraba = isEnable
  468. break
  469. case 'autorespond': case 'autoresponder':
  470. if (m.isGroup) {
  471. if (!(isAdmin || isOwner)) {
  472. global.dfail('admin', m, conn)
  473. throw false
  474. }}
  475. chat.autorespond = isEnable
  476. break
  477. case 'simi': case 'chatbot':
  478. if (m.isGroup) {
  479. if (!(isAdmin || isOwner)) {
  480. global.dfail('admin', m, conn)
  481. throw false
  482. }}
  483. chat.simi = isEnable
  484. break
  485. case 'anticommand': case 'antiarabe': case 'antiarabe2': case 'AntiCommand':
  486. isAll = true
  487. if (!isOwner) {
  488. global.dfail('rowner', m, conn)
  489. throw false
  490. }
  491. bot.anticommand = isEnable
  492. break
  493. case 'modoia': case 'chatgpt': case 'ia':
  494. isAll = true;
  495. if (!isOwner) {
  496. global.dfail('owner', m, conn);
  497. throw false;
  498. }
  499. bot.modoia = isEnable;
  500. break;
  501. case 'swonly': case 'statusonly':
  502. isAll = true
  503. if (!isOwner) {
  504. global.dfail('rowner', m, conn)
  505. throw false
  506. }
  507. global.opts['swonly'] = isEnable
  508. break
  509. default:
  510. if (!/[01]/.test(command)) return await m.reply(textoo)
  511. //conn.sendList(m.chat, texto, wm, `AJUSTES`, null, listSections, m)
  512. throw false
  513. }
  514. await m.reply(`🗂️ ʟᴀ ᴏᴘᴄɪᴏɴ ${type} ᴘᴀʀᴀ ${isAll ? 'ᴇsᴛᴇ ʙᴏᴛ' : isUser ? '' : 'ᴇsᴛᴇ ᴄʜᴀᴛ'} ғᴜᴇ ${isEnable ? 'ᴀᴄᴛɪᴠᴀᴅᴏ' : 'ᴅᴇsᴀᴄᴛɪᴠᴀᴅᴏ'} `)
  515. /*conn.sendButton(m.chat, `╭┄〔 *${wm}* 〕┄⊱
  516. ┆🗂️ ᴏᴘᴄɪᴏɴ: ${type}
  517. ┆——————«•»——————
  518. ┆🎚️ ᴇsᴛᴀᴅᴏ: ${isEnable ? 'ᴀᴄᴛɪᴠᴀᴅᴏ' : 'ᴅᴇsᴀᴄᴛɪᴠᴀᴅᴏ'}
  519. ┆——————«•»——————
  520. ┆📣 ᴘᴀʀᴀ: ${isAll ? 'ᴇsᴛᴇ ʙᴏᴛ' : isUser ? '' : 'ᴇsᴛᴇ ᴄʜᴀᴛ'}
  521. ╰━━━⊰ 𓃠 ${vs} ⊱━━━━დ`, wm, null, [[`${isEnable ? `Desactivar` : `Activar`}`, `${isEnable ? `.off ${type}` : `.on ${type}`}`]], null, null, m)*/
  522. };
  523. handler.help = ['en', 'dis'].map(v => v + 'able <option>')
  524. handler.tags = ['nable']
  525. handler.command = /^((en|dis)able|(tru|fals)e|(turn)?o(n|ff)|[01])$/i
  526. handler.register = true
  527. export default handler;
  528. const more = String.fromCharCode(8206)
  529. const readMore = more.repeat(4001)