text: from pyrogram import Client as Animefilter_bot, filters as Worker
  from Animefilter_bot1.database.autofilter_db import save_file
  from config import CHANNELS, ADMINS
  
  media_filter = Worker.document | Worker.video | Worker.audio
  
  @Animefilter_bot1.on_message(Worker.chat(CHANNELS) & media_filter)
  async def media(bot, message):
  
      for file_type in ("document", "video", "audio"):
          media = getattr(message, file_type, None)
          if media is not None:
              break
      else:
          return
  
      media.file_type = file_type
      media.caption = message.caption
      await save_file(media)
  
  
  @Animefilter_bot1.on_message(Worker.command('channel') & Worker.user(ADMINS))
  async def channel_info(bot, message):
      
      if isinstance(CHANNELS, (int, str)):
          channels = [CHANNELS]
      elif isinstance(CHANNELS, list):
          channels = CHANNELS
      else:
          raise ValueError("Unexpected type of CHANNELS")
  
      text = '📑 **Indexed channels/groups**\n'
      for channel in channels:
          chat = await bot.get_chat(channel)
          if chat.username:
              text += '\n@' + chat.username
          else:
              text += '\n' + chat.title or chat.first_name
  
      text += f'\n\n**Total:** {len(CHANNELS)}'
  
      if len(text) < 4096:
          await message.reply(text)
      else:
          file = 'Indexed channels.txt'
          with open(file, 'w') as f:
              f.write(text)
          await message.reply_document(file)
          os.remove(file)
  