amsync/obj.py
async def save(filename: str | None = None) -> None:
        """
        Saves all information from a chat to a .json
        """

        chat = await Chat.search()
        info = {
            'name': chat.name,
            'text': chat.text,
            'announcement': chat.announcement,

            'bg': chat.bg,
            'icon': chat.icon,

            'adm': chat.adm,
            'co_hosts': chat.co_hosts,

            'members_can_invite': chat.members_can_invite,
            'can_send_coins': chat.can_send_coins,
            'is_pinned': chat.is_pinned,
            'only_view': chat.only_view,
            'only_fans': chat.only_fans,

            'members': [i.id for i in await Chat.members()]
        }

        n = 0
        while Path(f'{n}.json').exists():
            n += 1
        with open(filename or f'{n}.json', 'w') as f:
            dump(info, f, indent=4, escape_forward_slashes=False)

        Saves all information from a chat to a .json
        
Saves all information from a chat to a .json
Saves all information from a chat to a . json
async def save(filename: str | None = None) -> None:
        chat = await Chat.search()
        info = {
            'name': chat.name,
            'text': chat.text,
            'announcement': chat.announcement,
            'bg': chat.bg,
            'icon': chat.icon,
            'adm': chat.adm,
            'co_hosts': chat.co_hosts,
            'members_can_invite': chat.members_can_invite,
            'can_send_coins': chat.can_send_coins,
            'is_pinned': chat.is_pinned,
            'only_view': chat.only_view,
            'only_fans': chat.only_fans,
            'members': [i.id for i in await Chat.members()]
        }
        n = 0
        while Path(f'{n}.json').exists():
            n += 1
        with open(filename or f'{n}.json', 'w') as f:
            dump(info, f, indent=4, escape_forward_slashes=False)
async def save ( filename : str | None = None ) -> None : chat = await Chat . search ( ) info = { 'name' : chat . name , 'text' : chat . text , 'announcement' : chat . announcement , 'bg' : chat . bg , 'icon' : chat . icon , 'adm' : chat . adm , 'co_hosts' : chat . co_hosts , 'members_can_invite' : chat . members_can_invite , 'can_send_coins' : chat . can_send_coins , 'is_pinned' : chat . is_pinned , 'only_view' : chat . only_view , 'only_fans' : chat . only_fans , 'members' : [ i . id for i in await Chat . members ( ) ] } n = 0 while Path ( f'{n}.json' ) . exists ( ) : n += 1 with open ( filename or f'{n}.json' , 'w' ) as f : dump ( info , f , indent = 4 , escape_forward_slashes = False )
Saves all information from a chat to a .json
Saves all information from a chat to a . json
"""
        Saves all information from a chat to a .json
        """
filename
str | None