grupo-config.js 1.2 KB

12345678910111213141516171819202122232425262728
  1. let handler = async (m, { conn, args, usedPrefix, command }) => {
  2. const pp = await conn.profilePictureUrl(m.chat, 'image').catch(_ => null) || './src/grupos.jpg'
  3. let isClose = { // Switch Case Like :v
  4. 'open': 'not_announcement',
  5. 'close': 'announcement',
  6. 'abierto': 'not_announcement',
  7. 'cerrado': 'announcement',
  8. 'abrir': 'not_announcement',
  9. 'cerrar': 'announcement',
  10. }[(args[0] || '')]
  11. if (isClose === undefined)
  12. throw `*โš ๏ธ ACCION MAL USADA*\n\n*โ€ข Usar ejemplo:*\n${usedPrefix + command} abrir\n${usedPrefix + command} cerrar`.trim()
  13. await conn.groupSettingUpdate(m.chat, isClose)
  14. if (isClose === 'not_announcement'){
  15. m.reply(`๐ŸŸข ๐™”๐˜ผ ๐™‹๐™๐™€๐˜ฟ๐™€๐™‰ ๐™€๐™Ž๐˜พ๐™๐™„๐˜ฝ๐™„๐™ ๐™๐™Š๐˜ฟ๐™Š๐™Ž ๐™€๐™‰ ๐™‚๐™๐™๐™‹๐™Š`)
  16. }
  17. if (isClose === 'announcement'){
  18. m.reply(`โš ๏ธ ๐™‚๐™๐™๐™‹๐™Š ๐˜พ๐™€๐™๐™๐˜ผ๐˜ฟ๐™Š ๐™Ž๐™Š๐™‡๐™Š ๐™‡๐™Š๐™Ž ๐˜ผ๐˜ฟ๐™ˆ๐™„๐™‰๐™Ž ๐™‹๐™๐™€๐˜ฟ๐™€๐™‰ ๐™€๐™Ž๐˜พ๐™๐™„๐˜ฝ๐™„๐™`)
  19. }}
  20. handler.help = ['group open / close', 'grupo abrir / cerrar']
  21. handler.tags = ['group']
  22. handler.command = /^(group|grupo)$/i
  23. handler.admin = true
  24. handler.botAdmin = true
  25. handler.exp = 200
  26. export default handler